[How To] Iterate List delimited by something
Posted: Mon Oct 21, 2013 12:27 pm
Greetings everyone.
I know this is noob question with a simple answer, but I have been looking for the answer and have not yet found it, so, If someone could help me, I really appreciate it.
I need to go through a list of item delimited by commas and for each item, do something with it
I know I can use the loops for that (Repeat-until, do-while, etc...) but my problem is handling the list.
The number of items in the list may be different each time the handler is called and it may look like this: "aaa,555,bb22,a b c d,1 2 3 4"
What can I do to get each element of the list?
If I use a repeat until loop (or something like that) with something like:
how can I know that I'm on the last item of the list OR that there are no more item on the list?
If the list delimiter is different, can I use the set the itemDelimiter to ":" to change it?
Many thanks, and sorry for this lame question ...
- Miguel
I know this is noob question with a simple answer, but I have been looking for the answer and have not yet found it, so, If someone could help me, I really appreciate it.
I need to go through a list of item delimited by commas and for each item, do something with it
I know I can use the loops for that (Repeat-until, do-while, etc...) but my problem is handling the list.
The number of items in the list may be different each time the handler is called and it may look like this: "aaa,555,bb22,a b c d,1 2 3 4"
What can I do to get each element of the list?
If I use a repeat until loop (or something like that) with something like:
Code: Select all
put item i of myList into tVar
how can I know that I'm on the last item of the list OR that there are no more item on the list?
If the list delimiter is different, can I use the set the itemDelimiter to ":" to change it?
Many thanks, and sorry for this lame question ...
- Miguel