<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Infinite loop in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89885#M33856</link>
    <description>AFAIK is there still no hotkey to stop it. No autosave for objects too.</description>
    <pubDate>Tue, 06 Jun 2006 10:30:42 GMT</pubDate>
    <dc:creator>Frank Beister</dc:creator>
    <dc:date>2006-06-06T10:30:42Z</dc:date>
    <item>
      <title>Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89884#M33855</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I have just created yet another accidental infinite loop in GDL. I always feel this reflects well on my GDL skills, since this probably doesn't happen much to a novice. &lt;BR /&gt;
&lt;BR /&gt;
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.&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Jun 2006 09:39:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89884#M33855</guid>
      <dc:creator>David Collins</dc:creator>
      <dc:date>2006-06-06T09:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89885#M33856</link>
      <description>AFAIK is there still no hotkey to stop it. No autosave for objects too.</description>
      <pubDate>Tue, 06 Jun 2006 10:30:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89885#M33856</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-06-06T10:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89886#M33857</link>
      <description>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:&lt;BR /&gt;

&lt;PRE&gt;REPEAT
    ! Some useful code here
    count = count + 1
    IF count &amp;gt; 10^6 THEN 100
UNTIL pigs = "fly"
100: !Get out of loop free card&lt;/PRE&gt;

This 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).&lt;BR /&gt;
&lt;BR /&gt;
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.</description>
      <pubDate>Tue, 06 Jun 2006 12:55:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89886#M33857</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-06T12:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89887#M33858</link>
      <description>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.</description>
      <pubDate>Tue, 06 Jun 2006 13:47:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89887#M33858</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-06-06T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89888#M33859</link>
      <description>&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;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.&lt;/BLOCKQUOTE&gt;

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.</description>
      <pubDate>Tue, 06 Jun 2006 13:58:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89888#M33859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-06T13:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89889#M33860</link>
      <description>&lt;BLOCKQUOTE&gt;I'll have to remember that.&lt;/BLOCKQUOTE&gt;Would be nice if I would every time too. &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;</description>
      <pubDate>Tue, 06 Jun 2006 13:59:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89889#M33860</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-06-06T13:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89890#M33861</link>
      <description>&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;I'll have to remember that.&lt;/BLOCKQUOTE&gt;Would be nice if I would every time too. &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;/BLOCKQUOTE&gt;

I know what you mean  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_confused.gif" style="display : inline;" /&gt;</description>
      <pubDate>Tue, 06 Jun 2006 14:04:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89890#M33861</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-06T14:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Infinite loop</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89891#M33862</link>
      <description>Thanks for the input, gentlemen&lt;BR /&gt;
&lt;BR /&gt;
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.</description>
      <pubDate>Wed, 07 Jun 2006 16:56:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Infinite-loop/m-p/89891#M33862</guid>
      <dc:creator>David Collins</dc:creator>
      <dc:date>2006-06-07T16:56:43Z</dc:date>
    </item>
  </channel>
</rss>

