<?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: AC processes a subroutine placed after the END: tag. AC in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20250#M37947</link>
    <description>Also, you might want to google up the online version of the GDL Cookbook. There's a good section there on subroutines.</description>
    <pubDate>Sun, 13 Feb 2005 09:14:52 GMT</pubDate>
    <dc:creator>David Collins</dc:creator>
    <dc:date>2005-02-13T09:14:52Z</dc:date>
    <item>
      <title>AC processes a subroutine placed after the END: tag. AC 8.1</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20247#M37944</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hello:&lt;BR /&gt;
&lt;BR /&gt;
I have a feeling I may have asked this question some time ago althought I can't find any record of it in the database.&lt;BR /&gt;
&lt;BR /&gt;
I find AC will process a subroutine placed after the END: tag. This means I can't put a conditional branch in the main event. &lt;BR /&gt;
&lt;BR /&gt;
I've written five door GDL which I attempted to combine into a single macro. It doesn't work because AC insists on running uncalled sub-routines.&lt;BR /&gt;
&lt;BR /&gt;
Q: how do other users get around this problem.&lt;BR /&gt;
&lt;BR /&gt;
Here is a simple example which illustrates the problem.&lt;BR /&gt;
&lt;BR /&gt;
!	3D script&lt;BR /&gt;
	if first then&lt;BR /&gt;
		gosub 1&lt;BR /&gt;
	else&lt;BR /&gt;
	if second then&lt;BR /&gt;
		gosub 2&lt;BR /&gt;
	endif&lt;BR /&gt;
	endif&lt;BR /&gt;
&lt;BR /&gt;
end:&lt;BR /&gt;
&lt;BR /&gt;
1:&lt;BR /&gt;
	pen 10&lt;BR /&gt;
	circle 0.1&lt;BR /&gt;
	circle 0.05&lt;BR /&gt;
&lt;BR /&gt;
2:&lt;BR /&gt;
	pen 1&lt;BR /&gt;
	circle 0.01&lt;BR /&gt;
&lt;BR /&gt;
If both are false I get nothing.&lt;BR /&gt;
If second is true and first is false, I get one circle, the correct one.&lt;BR /&gt;
However, if first is true and second false, I get three circles which is incorrect.&lt;BR /&gt;
&lt;BR /&gt;
Cordialement: DW&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 May 2023 08:36:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20247#M37944</guid>
      <dc:creator>Hubert Wagner</dc:creator>
      <dc:date>2023-05-24T08:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: AC processes a subroutine placed after the END: tag. AC</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20248#M37945</link>
      <description>Douglas: &lt;BR /&gt;
 &lt;BR /&gt;
You need to add a RETURN statement at the end of each subroutine, otherwise ArchiCAD doesn't know where the subroutine ends in order to return to the main event. You might find that looking at some of the objects that come with ArchiCAD helpful in catching these sort of organizational problems. &lt;BR /&gt;
 &lt;BR /&gt;
HTH &lt;BR /&gt;
 &lt;BR /&gt;
David</description>
      <pubDate>Sat, 12 Feb 2005 15:02:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20248#M37945</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2005-02-12T15:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: AC processes a subroutine placed after the END: tag. AC</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20249#M37946</link>
      <description>Yes you need returns&lt;BR /&gt;
Also depending on what your script is trying to do it is might be easier to write your script as&lt;BR /&gt;
&lt;BR /&gt;
if first then gosub 1&lt;BR /&gt;
if second then gosub 2&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
1: subroutine1&lt;BR /&gt;
return&lt;BR /&gt;
2: subroutine2&lt;BR /&gt;
return&lt;BR /&gt;
&lt;BR /&gt;
of course your script might require first to be not true before second occurs so ignore above</description>
      <pubDate>Sat, 12 Feb 2005 23:47:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20249#M37946</guid>
      <dc:creator>Aussie John</dc:creator>
      <dc:date>2005-02-12T23:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: AC processes a subroutine placed after the END: tag. AC</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20250#M37947</link>
      <description>Also, you might want to google up the online version of the GDL Cookbook. There's a good section there on subroutines.</description>
      <pubDate>Sun, 13 Feb 2005 09:14:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/AC-processes-a-subroutine-placed-after-the-END-tag-AC-8-1/m-p/20250#M37947</guid>
      <dc:creator>David Collins</dc:creator>
      <dc:date>2005-02-13T09:14:52Z</dc:date>
    </item>
  </channel>
</rss>

