Page 1 of 1

Strange $loop and $next values

Posted: Wed Aug 12, 2009 5:52 pm
by michel.weber
I have written a small vortex script that does a loop.
When i print $loop and $next everything is like expected (i.e. they are incremented and $next=$loop+1)
I added a <rex> to the loop.
When i print $ loop and $next after the <rex> they are both either 0 or one and $loop=$next.

What am i missing?

Strange $loop and $next values

Posted: Thu Aug 13, 2009 1:36 am
by John
<rex> is a looping operator with options, so you can say for example:

<rex ROW "\alpha+" $Var>
Word[$loop] is $ret
</rex>

You can save the values of $loop and $next to other variables at the top of the loop if you need to use them later.