Lars Stokholm
2005-01-13 13:35:49 UTC
I have defined this array in some slrn macro:
variable strings = String_Type [1];
This does what it's supposed to:
() = sscanf (line, "%*[^|]|%[^|]|%*[^|]|%*[^|]", &testvar);
strings[0] = testvar;
() = fputs (strings[0], s_sig);
It reads a string into testvar, copies it to strings[0] and
writes strings[0] into the s_sig file.
I should think that this would essentially do the same thing:
() = sscanf (line, "%*[^|]|%[^|]|%*[^|]|%*[^|]", &strings[0]);
() = fputs (strings[0], s_sig);
But it doesn't. I get this error: "S-Lang Error: Type Mismatch:
Unable to typecast Integer_Type to String_Type".
It seems that strings[0] is an integer. Why? What's wrong?
variable strings = String_Type [1];
This does what it's supposed to:
() = sscanf (line, "%*[^|]|%[^|]|%*[^|]|%*[^|]", &testvar);
strings[0] = testvar;
() = fputs (strings[0], s_sig);
It reads a string into testvar, copies it to strings[0] and
writes strings[0] into the s_sig file.
I should think that this would essentially do the same thing:
() = sscanf (line, "%*[^|]|%[^|]|%*[^|]|%*[^|]", &strings[0]);
() = fputs (strings[0], s_sig);
But it doesn't. I get this error: "S-Lang Error: Type Mismatch:
Unable to typecast Integer_Type to String_Type".
It seems that strings[0] is an integer. Why? What's wrong?