I've been avoiding looping constructs like the plague ๐ Not because they're difficult to do, but because the support possibilities scare the hell out of me.
If you unfold the loop and have successive blocks of code or calls to routines it is possible now. (Yah I know it's pretty distasteful).
Copy Genre to Variable 1
if exists Variable 1
Copy Variable 1 to Variable 2
Find ',' in Variable 2 and remove it and everything after
Trim Variable 2
Find ', 'in Variable 1 and remove it and everything before
Trim Variable 1
# this assumes you never have ',,'
if exists variable 2
# do your work base on variable 2
end if
# duplicate the code (Variable 1 has the remainder of the list)
endif
Yuck!
Maybe something like the following:
For Each variable from field delimited by d run action
In your case:
For Each Variable 1 from Genre delimited by ',' run Create_Genre_Sym_Links1
Variable 1 would contain the non empty genre when Create_Genre_Sym_Links is called.
If multiple files were selected, the effective list would be the merge of the individual lists. The function would be case insensitive (optional?). Empty items would be ignored. A snapshot of the field would be taken at the start of execution. ie. changing the genre field would not affect the looping.
This will be somewhat simpler to support than a generic looping construct as the execution profile would always be finite.
This also has the advantage that you could use it to access individual elements when using multiple items as opposed to delimited items. You would simply use the multiple item delimiter. ';;;' or even better '\m'.
What do you think?
|