$loop variable is set at the start of every iteration (and
at the non-
BREAK end) of looping statements, e.g.
TIMPORT, etc. Inside the loop, it is the iteration
count (counting from 0); at the end of the loop, it is thus the number
Note that for
$loop also includes the
SKIP value; this is not true for other looping
statements. Note also that for
is set before the
WHILE condition is evaluated, so that
$loop may be used as a iterator in the condition.
Note that in version 8 and later syntax (
$ret.code variable is a
more reliable way of checking success/failure of a
statement than checking
$loop, as the latter can be 0 for a
zero-result-row successful statement as well as a failed statement.