TomWaltz wrote:
In C++, there is a keyword CONTINUE, which is used inside a Do.. While or Repeat...Until loop. This keyword aborts the current loop, and starts over at the top.
I have not been able to find any equivalent in GDL. Is there some strange undocumented method I am missing?
I think you meant to say "short circuits the current iteration of the enclosing loop", rather than "aborts the current loop"...
The GDL equivalent is ...(groan): GOTO.
More precisely, a GOTO to a label that is just before the NEXT statement.
Frequently it can be avoided using IF-THEN logic, but sometimes you have to introduce enough 'flag' variables/logic that the 'CONTINUE' approach looks appealing. For large loops, maintenance (future comprehension) becomes an issue ... so I suggest at least putting !! CONTINUE at the end of the GOTO line (or something like that) to remind you of the function of the GOTO.
😉
Karl
[Edited: typos]
One of the forum moderators
AC 27 USA and earlier • macOS Ventura 13.6.6, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB