I am trying to carry out the simple task of getting a string with
comma delimiters and produce a string_array with the values in between
the commas; this would simplify calling the different parts of the
string.
Example:
INPUT: this,is,an,example
OUTPUT: this|is|an|example (this would be an array of strings)
Using a while loop with the two VI "Scan String For Tokens" and
"Insert to array" should be enough to carry this task. I started
using a FOR loop as the number of tokens I´ll be using is fixed.
However I wanted to make the subVI more general by allowing any
#tokens in the input string and using the token index with a WHILE
loop to do this. The "token index" output from the "Scan String For
Tokens" is said to be use
d in a while loop to process the whole
string.
However,I´m getting -1 as an output even if I´ve got more tokens left
and the while loop therefore exits.
What am I doing wrong?
Should I use -2 as the comparison to decide whether I´m at hte end or
not of the string?
Cheers and TIA