Infinite loop

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 11:39 AM
2006-06-06
11:39 AM
So, as a buzillion roof beams spiral off into the vanishing point, I wonder if there's any way to stop them? Dropping out of a non-responsive ArchiCAD leaves me the autosave of the main file, but the GDL work in progress is just plain gone.
David Collins
Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 12:30 PM
2006-06-06
12:30 PM
AFAIK is there still no hotkey to stop it. No autosave for objects too.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 02:55 PM
2006-06-06
02:55 PM
It is always a good idea to save before running a script that has this potential. You might be able to get out of the loop with a command/ctrl + . (period/fullstop). Most infinite loops occur in REPEAT...UNTIL and WHILE...ENDWHILE conditions since it is easy for the terminal condition to never be met. I don't know if this is your situation, but a simple remedy is to put a simple counter inside the loop that will bail out after some large number of iterations. For example:
I have used a similar approach for loops where I couldn't predict the conditional value and it was easier to get out with the IF statement.
REPEAT ! Some useful code here count = count + 1 IF count > 10^6 THEN 100 UNTIL pigs = "fly" 100: !Get out of loop free cardThis example will count to one million before bailing out which may be excessive for your needs, but it should take well under 1000 seconds to execute (I recall testing the loops at around a millisecond once, but that was on a MUCH slower computer than anything we use now).
I have used a similar approach for loops where I couldn't predict the conditional value and it was easier to get out with the IF statement.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 03:47 PM
2006-06-06
03:47 PM
I most use FOR - NEXT loops, which do not loop endless so easy. Saving before trying is not every time the hint, because AC precompiles the code before saving and might run into the endlessness too. If I have not saved a long time ago and if I do not trust my code I set an END at the beginning of the master-script before saving and delete it afterwards for the test.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 03:58 PM
2006-06-06
03:58 PM
F. wrote:Point well taken. I usually comment out the questionable code before saving, but that's a good idea about the END statement. I'll have to remember it.
I most use FOR - NEXT loops, which do not loop endless so easy. Saving before trying is not every time the hint, because AC precompiles the code before saving and might run into the endlessness too. If I have not saved a long time ago and if I do not trust my code I set an END at the beginning of the master-script before saving and delete it afterwards for the test.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 03:59 PM
2006-06-06
03:59 PM
I'll have to remember that.Would be nice if I would every time too.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-06 04:04 PM
2006-06-06
04:04 PM
F. wrote:I know what you meanI'll have to remember that.Would be nice if I would every time too.😉


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-06-07 06:56 PM
2006-06-07
06:56 PM
Thanks for the input, gentlemen
I figure if I ever need to defeat an evil super computer which threatens to kill my crew and steal my ship, this would be the way to go.
I figure if I ever need to defeat an evil super computer which threatens to kill my crew and steal my ship, this would be the way to go.
David Collins
Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)