For Loop over comma seperated String
Hi Community,
My old code:
for x=1,2,3
.dosomethig(x)
Now i Want to customize the comma separated List get from a ClassMethod as String. -> set customString = „1,3,9“
but
for x=customString
.dosomething(x)
wont work for me.
also
for x=$LFS(customString)
.dosomething(x)
doesnt work for me.
i dont want to change the for Loop With an iterator.
is there a possible way to cast the string into a „comma separated List“ for My for Loop?
best regards,
Florian
Product version: Caché 2018.1
Discussion (0)0
Comments
s list =$LISTFROMSTRING(line,",",2)
x"for x="_customString_" do something(x)"F x=1:1:$L(customString,",") dosomething($P(customString,",",x))