The $next variable is set at the start of every iteration (and
at the non-BREAK end) of looping statements, e.g. LOOP,
SQL, TIMPORT etc. Inside the loop, it is equal to the
iteration count (counting from 1), plus the SKIP value. At the
end of the loop, it is thus the value to use for SKIP in a new
LOOP or SQL to continue iterating at the next value.
In version 8.00.1645136290 20220217 and later,
$next is also set at the end of self-closing optional-looping
statements, just as if the statement was looping.