<?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: Multiple IF statements in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335224#M2796</link>
    <description>&lt;P&gt;You did not close the second and third last IF statement with ENDIF&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2022 08:18:44 GMT</pubDate>
    <dc:creator>Jochen Suehlo</dc:creator>
    <dc:date>2022-04-11T08:18:44Z</dc:date>
    <item>
      <title>Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335219#M2794</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to set multiple IF statements depending on a values list set on the Paramaters. If I set only to statements everything works as expected, but when I add more than two statements I get an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;!!!!!======== MODULE WIDTH ===========
IF WIDTH="600" THEN MOD_WIDTH=0.6

IF WIDTH="900" THEN
	MOD_WIDTH=0.9

ENDIF

!!!!!======== MODULE DEPTH ===========
IF DEPTH="300" THEN MOD_DEPTH=0.3

IF DEPTH="400" THEN
	MOD_DEPTH=0.4

IF DEPTH="500" THEN 
	MOD_DEPTH=0.5

IF DEPTH="600" THEN
	MOD_DEPTH=0.6

ENDIF


RECT2 0,0, MOD_WIDTH, MOD_DEPTH&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Juan.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 07:30:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335219#M2794</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2022-04-11T07:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335223#M2795</link>
      <description>&lt;P&gt;If your IF/THEN is all on one line, you don't need an ENDIF.&lt;/P&gt;
&lt;P&gt;If you split it over multiple lines then you do need an ENDIF for every IF/THEN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF WIDTH="600" THEN MOD_WIDTH=0.6

IF WIDTH="900" THEN
	MOD_WIDTH=0.9
ENDIF

!!!!!======== MODULE DEPTH ===========
IF DEPTH="300" THEN MOD_DEPTH=0.3 !!!don't need ENDIF if single line

IF DEPTH="400" THEN
	MOD_DEPTH=0.4
ENDIF

IF DEPTH="500" THEN 
	MOD_DEPTH=0.5
ENDIF

IF DEPTH="600" THEN
	MOD_DEPTH=0.6
ENDIF


RECT2 0,0, MOD_WIDTH, MOD_DEPTH&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for the sake of clean coding I would do them all the same way.&lt;/P&gt;
&lt;P&gt;I prefer to split them over multiple lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:18:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335223#M2795</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2022-04-11T08:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335224#M2796</link>
      <description>&lt;P&gt;You did not close the second and third last IF statement with ENDIF&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:18:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335224#M2796</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2022-04-11T08:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335226#M2797</link>
      <description>&lt;P&gt;Unrelated to the question, BUT if your input is set to "Length Type" it is automatically converted to meters in the scripts. So an input value of 300 (mm) is read as 0.3 in the script. Your parameter script would then be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;VALUES "Depth" 0.3, 0.4, 0.5, 0.6, 0.9&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In doing this, there would be no need to have all of these statements to convert your "Text Type" into a "Length Type". Unless I guess if you are wanting to include text within the input for what ever reason, or the usage is completely different to what I am thinking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:37:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335226#M2797</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2022-04-11T08:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335227#M2798</link>
      <description>&lt;P&gt;Thank you for pointing it out, just noticed and fixed it in VALUES.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:41:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335227#M2798</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2022-04-11T08:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335228#M2799</link>
      <description>&lt;P&gt;Nood question of the day, there is no performance difference between one line IF or split it in multiple lines?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:42:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335228#M2799</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2022-04-11T08:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335229#M2800</link>
      <description>&lt;P&gt;Thank you, that was my problem/doubt.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:42:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335229#M2800</guid>
      <dc:creator>jc4d</dc:creator>
      <dc:date>2022-04-11T08:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335230#M2801</link>
      <description>&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;I just think it is clearer on multiple lines.&lt;/P&gt;
&lt;P&gt;Then you can indent between the IF/ENDIF to make it clear that it is a little group.&lt;/P&gt;
&lt;P&gt;Seeing as we have no colour coding of scripts in GDL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:47:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335230#M2801</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2022-04-11T08:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335231#M2802</link>
      <description>&lt;P&gt;I would also avoid scripting in&amp;nbsp;&lt;EM&gt;ALL CAPS&lt;/EM&gt; and keep capitalisation to key things such as commands for additional clarity.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 09:11:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335231#M2802</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2022-04-11T09:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335471#M2803</link>
      <description>&lt;P&gt;Generally users aren't affected by GDL code performance. Executing the script is much faster than showing its result model/drawing.&lt;/P&gt;
&lt;P&gt;SEO operations (groups, cuts), large file I/O can start to be problematic.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 10:38:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Multiple-IF-statements/m-p/335471#M2803</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2022-04-13T10:38:24Z</dc:date>
    </item>
  </channel>
</rss>

