cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

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]
AC 28 USA and earlier   •   macOS Sequoia 15.3.1, 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