BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

GDL Program flow question

TomWaltz
Participant
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?
Tom Waltz
2 REPLIES 2
Karl Ottenstein
Moderator
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
TomWaltz
Participant
Karl

you're right, I wanted to "short circuit" the current loop.

I was afraid you were going to say to use GOTO. Amazing how repulsive that feels!
Tom Waltz
Learn and get certified!