<?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: How to define Subroutine in Master Script in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231591#M5557</link>
    <description>Tsepov:&lt;BR /&gt;
&lt;BR /&gt;
It looks like the GOSUB command needs an "END" to work, and as you discovered, an "END" in the Master Script prevents the other scripts from running. You might be able to accomplish the same result using IF/THEN statements, which do work in the Master Script.&lt;BR /&gt;
&lt;BR /&gt;
You can also ask here: &lt;A href="http://gdl.graphisoft.com/forums" target="_blank"&gt;GDL Center - Forums&lt;/A&gt;.&lt;BR /&gt;
&lt;BR /&gt;
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
    <pubDate>Fri, 22 Sep 2017 13:08:02 GMT</pubDate>
    <dc:creator>David Maudlin</dc:creator>
    <dc:date>2017-09-22T13:08:02Z</dc:date>
    <item>
      <title>How to define Subroutine in Master Script</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231590#M5556</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;On Master Script I need to do any calculations.&lt;BR /&gt;
Whan I define subroutine, GDL says "Return without GoDub" error&lt;BR /&gt;
&lt;BR /&gt;
!----------------&amp;gt;&lt;BR /&gt;
GOSUB "MySub"&lt;BR /&gt;
&lt;BR /&gt;
!-----------------&lt;BR /&gt;
! defite MySub&lt;BR /&gt;
!-----------------&lt;BR /&gt;
"MySub":&lt;BR /&gt;
RETURN&lt;BR /&gt;
!&amp;lt;---------------&lt;BR /&gt;
&lt;BR /&gt;
And if I write instruction END before define my subrotine, GDL say no errors, but...&lt;BR /&gt;
2d and other script are not executes &lt;BR /&gt;
&lt;BR /&gt;
!----------------&amp;gt;&lt;BR /&gt;
GOSUB "MySub"&lt;BR /&gt;
END&lt;BR /&gt;
!-----------------&lt;BR /&gt;
! defite MySub&lt;BR /&gt;
!-----------------&lt;BR /&gt;
"MySub":&lt;BR /&gt;
RETURN&lt;BR /&gt;
!&amp;lt;---------------&lt;BR /&gt;
&lt;BR /&gt;
Please, help me!&lt;BR /&gt;
How I can define and use subroutine in master gdl?&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Sep 2017 05:20:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231590#M5556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-22T05:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to define Subroutine in Master Script</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231591#M5557</link>
      <description>Tsepov:&lt;BR /&gt;
&lt;BR /&gt;
It looks like the GOSUB command needs an "END" to work, and as you discovered, an "END" in the Master Script prevents the other scripts from running. You might be able to accomplish the same result using IF/THEN statements, which do work in the Master Script.&lt;BR /&gt;
&lt;BR /&gt;
You can also ask here: &lt;A href="http://gdl.graphisoft.com/forums" target="_blank"&gt;GDL Center - Forums&lt;/A&gt;.&lt;BR /&gt;
&lt;BR /&gt;
You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Fri, 22 Sep 2017 13:08:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231591#M5557</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2017-09-22T13:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to define Subroutine in Master Script</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231592#M5558</link>
      <description>You can use subroutines in the master script as well.&lt;BR /&gt;
Try the following:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;! Code
GOSUB 100
GOSUB 200
GOTO "MasterEnd"
! Here you can place an END, but you must not 
100; !  1st Subroutine
RETURN

200: ! 2nd subroutine
RETURN

"MasterEnd":
&lt;/PRE&gt;

The good thing is, that you can write in 2D and 3D Scripts "Gosub 100"&lt;BR /&gt;
and the subroutines in the master script are executed.</description>
      <pubDate>Fri, 22 Sep 2017 14:19:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-define-Subroutine-in-Master-Script/m-p/231592#M5558</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2017-09-22T14:19:11Z</dc:date>
    </item>
  </channel>
</rss>

