[SR-Users] How to iterate comma separated string

Alex Balashov abalashov at evaristesys.com
Tue Jun 11 15:54:20 CEST 2013


Mino,

Something like this should probably work:

    $var(x) = "1,2,3,4";

    $var(i) = 0;

    while(defined $(var(x){s.select,$var(i),,})) {
       ...

       $var(i) = $var(i) + 1;
    }

If the 'defined' operator always results 'true' on the results of this 
transformation, then alternately this:

    while($(var(x){s.select,$var(i),,}{s.len}) > 0)

-- Alex

-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-users mailing list