The Strtok function returns a reference to each subsequent token in the string, after replacing the separator character with a NULL character. When no more tokens remain, a null string is returned. Note that this is destructive to str.
This function is similar to the C library ``strtok'' function.
Example: print the space-separated words
teststr = "here are \tsome words"
word = Strtok(teststr, " \t")
Print("First word is", word);
while (word = Strtok(0, " \t"))
Print("Next word:", word)
done
string length | arg is a string |
allocated array size | arg is an array |
number of trapezoids | arg is a zoidlist |
1 | arg is none of above |
The function fails if the first argument is not a string, is null, or there is a syntax error or unsupported construct, or there is a type or number mismatch between specification and arguments.
For example, the ``id'' returned from GetObjectID prints as a floating point value by default (since it is a large integer), which is usually not useful. One can print this as a hex value as follows:
id = GetObjectID(handle)
Print("Id =", ToFormat("0x%x", id))