Vortex loop - internals
Posted: Wed Oct 20, 2010 2:35 pm
Can anyone explain to me how internally vortex handles $next variable inside nested loop? This could cause serious problems especially when calling functions.
If we have two nested loops, after leaving the inner loop, $next variable value is not set to the $next variable value of outer loop.
Below is an example.
<script language=vortex>
<a name=main>
<$AS1 = "pera" "zika">
<$AS2 = "pera" "zika" "mika">
<loop $AS1>
OUTER:before: -$next
<loop $AS2>
inner:before: $next
<testfunc str=$AS2>
inner:after: $next
</loop>
OUTER:after: -$next
</loop>
</a>
<a name=testfunc str>
<rex row '.' $str>
+$next
</rex>
</a>
</script>
If we have two nested loops, after leaving the inner loop, $next variable value is not set to the $next variable value of outer loop.
Below is an example.
<script language=vortex>
<a name=main>
<$AS1 = "pera" "zika">
<$AS2 = "pera" "zika" "mika">
<loop $AS1>
OUTER:before: -$next
<loop $AS2>
inner:before: $next
<testfunc str=$AS2>
inner:after: $next
</loop>
OUTER:after: -$next
</loop>
</a>
<a name=testfunc str>
<rex row '.' $str>
+$next
</rex>
</a>
</script>