$loop/$next Set By Non-looping Versions of Loopable Statements - Caveat

Since only non-looping (self-closed) versions of loopable statements accumulate values in syntax version 8, $loop/$next are now also set in such cases (this was not true in syntax version 7 and earlier). Thus, accumulating-values looping statements from version 7 ported to version 8 - as accumulating non-looping statements - can continue to use $loop/$next to count values. This is useful because even though there is a count syntax in version 8 - e.g. $#ret - it may be unreliable for <sql/> and <timport/>, which cannot always set their return variables, e.g. on syntax errors.

Note however, that existing version 7 code that already uses e.g. <sql/> might be expecting it not to set $loop, and may thus need to be adapted (e.g. save/restore earlier $loop).

Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.