<?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 Using returned request parameters in IF statements in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282798#M4986</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I am currently trying to develop an door and window marker to display a particular manufacturers code dependent on size, window type and transom location. I have successfully managed to return the information and display it via a text box however I cant manage to utilize the information to set my own predefined parameters.&lt;BR /&gt;&lt;BR /&gt;In the below the text2 command shows the correct boolean response however I cant use it to define the "T_Widotrans_Code" text parameter&lt;BR /&gt;&lt;BR /&gt;I am also trying a similar process to call the name of the window and define a code with similar levels of success&lt;BR /&gt;&lt;BR /&gt;Is there something I'm missing.... its driving me Bonkers&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;!!!! MASTER SCRIPT !!!!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;val_TSOM=0&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;!!!! 2D SCRIPT !!!!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;t=REQUEST("ASSOCLP_PARVALUE","gs_LTrans",trans_name,type_T,flag_T,dim1,dim2,val_TSOM)&lt;BR /&gt;TEXT2 0,0,val_TSOM&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;!!!! PARAMTER SCRIPT !!!!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;IF val_TSOM=0 THEN PARAMETERS T_Widotrans_Code = "" ELSE: PARAMETERS T_Widotrans_Code = "T" :ENDIF&lt;/DIV&gt;</description>
    <pubDate>Wed, 15 Sep 2021 07:45:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-15T07:45:11Z</dc:date>
    <item>
      <title>Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282798#M4986</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I am currently trying to develop an door and window marker to display a particular manufacturers code dependent on size, window type and transom location. I have successfully managed to return the information and display it via a text box however I cant manage to utilize the information to set my own predefined parameters.&lt;BR /&gt;&lt;BR /&gt;In the below the text2 command shows the correct boolean response however I cant use it to define the "T_Widotrans_Code" text parameter&lt;BR /&gt;&lt;BR /&gt;I am also trying a similar process to call the name of the window and define a code with similar levels of success&lt;BR /&gt;&lt;BR /&gt;Is there something I'm missing.... its driving me Bonkers&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;!!!! MASTER SCRIPT !!!!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;val_TSOM=0&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;!!!! 2D SCRIPT !!!!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;t=REQUEST("ASSOCLP_PARVALUE","gs_LTrans",trans_name,type_T,flag_T,dim1,dim2,val_TSOM)&lt;BR /&gt;TEXT2 0,0,val_TSOM&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;!!!! PARAMTER SCRIPT !!!!&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;IF val_TSOM=0 THEN PARAMETERS T_Widotrans_Code = "" ELSE: PARAMETERS T_Widotrans_Code = "T" :ENDIF&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 07:45:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282798#M4986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T07:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282799#M4987</link>
      <description>Did you try to put the REQUEST on the Master Script?  Or even in the Parameter Script?&lt;BR /&gt;
Hope this helps.</description>
      <pubDate>Fri, 25 Sep 2020 09:28:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282799#M4987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-25T09:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282800#M4988</link>
      <description>&lt;FONT color="#000000"&gt;@MICHAEL ISERIEF&lt;BR /&gt;
&lt;BR /&gt;
Using requests or any of their versions, and I quote from ArchiCAD's 23 GDL Reference Guide
&lt;BLOCKQUOTE&gt;
&lt;COLOR color="#000000"&gt;Compatibility up to ARCHICAD 19: The use of most requests in parameter scripts (or master scripts run as parameter script) could result in unreliable returned values.&lt;/COLOR&gt;
&lt;/BLOCKQUOTE&gt;&lt;COLOR color="#000000"&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;copied from REQUEST OPTIONS &amp;gt; Request Parameter Script Compatibility &amp;gt; Page 481&lt;E&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
ie: it means, that using request in Parameter Script or in Master Script were it's part of the script is being interpreted as Parameter Script will cause trouble&lt;BR /&gt;
&lt;BR /&gt;
Which I see that you have managed to avoid ...&lt;BR /&gt;
&lt;BR /&gt;
1. Read the manual's GDL styling ... and start by adding spaces for god's sake, you're not saving bytes on your storage device worth considering and you're making reading the script a lot harder on everybody including yourself.&lt;BR /&gt;
&lt;BR /&gt;
2.  I would have solved this in another way ... starting in the Master Script:&lt;BR /&gt;
&lt;B&gt;&lt;FONT color="#FF0000"&gt;delete val_TSOM = 0&lt;/FONT&gt;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
The reason is that Master Script although is the first script to run, you can not detect successfully if it would run again after the the execution of Parameter Script or the UI Script, so it will be as if you have set "val_TSOM = 0" as preferential value.&lt;BR /&gt;
&lt;BR /&gt;
3.  "2D Script", I would have added the following line in blue:&lt;BR /&gt;
t = REQUEST ("ASSOCLP_PARVALUE", "gs_LTrans", trans_name, type_T, flag_T, dim1, dim2, val_TSOM)&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT color="#0000BF"&gt;val_TSOM = val_TSOM&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
TEXT2 0,0,val_TSOM&lt;BR /&gt;
&lt;BR /&gt;
That way, you have consolidated "val_TSOM" variable value in memory.&lt;BR /&gt;
&lt;BR /&gt;
4. Modify the parameter script to Graphisoft's styling and leave it as it is.&lt;BR /&gt;
&lt;BR /&gt;
Try it out and comment&lt;/COLOR&gt;&lt;/FONT&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:03:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282800#M4988</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2020-09-28T10:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282801#M4989</link>
      <description>Why do you need to change the marker's parameters? Could they be variables instead?&lt;BR /&gt;
&lt;BR /&gt;
PS. Regarding Moonlight's recommendations I think val_TSOM = 0 is perfect in the master script, the master script isn't executed &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;after&lt;E&gt;&lt;/E&gt; any script, only before. It needs to be initialized &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;before &lt;E&gt;&lt;/E&gt; the request, for the case the request fails.</description>
      <pubDate>Mon, 28 Sep 2020 10:42:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282801#M4989</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2020-09-28T10:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282802#M4990</link>
      <description>&lt;BLOCKQUOTE&gt;1. Read the manual's GDL styling ... and start by adding spaces for god's sake, you're not saving bytes on your storage device worth considering and you're making reading the script a lot harder on everybody including yourself.&lt;/BLOCKQUOTE&gt;

Yeah, sorry about that, I'm a bit of a novice regarding this and I'm usually the only one reading these scripts. Let me know if the below is a bit easier to read.&lt;BR /&gt;
&lt;BR /&gt;
t=REQUEST("ASSOCLP_PARVALUE","gs_LTrans",trans_name,type_T,flag_T,dim1,dim2,bTsom)&lt;BR /&gt;
&lt;BR /&gt;
bTsom = bTsom&lt;BR /&gt;
&lt;BR /&gt;
IF bTsom=0 THEN &lt;BR /&gt;
	stTransCode = "" &lt;BR /&gt;
ELSE &lt;BR /&gt;
	stTransCode = "T"&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
TEXT2 0,0,bTsom&lt;BR /&gt;
TEXT2 0,-.5,stTransCode&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;PS. Regarding Moonlight's recommendations I think val_TSOM = 0 is perfect in the master script, the master script isn't executed after any script, only before. It needs to be initialized before the request, for the case the request fails.&lt;/BLOCKQUOTE&gt;

Thanks Peter, you were certainly correct about the val_TSOM (now bTsom per moonlights comments) I was getting an uninitialized variable warning without it.&lt;BR /&gt;
&lt;BR /&gt;
Also the using variables instead of parameters was a lot easier (I was still having issues using the string parameter I had set up for some reason)&lt;BR /&gt;
&lt;BR /&gt;
The script works "perfectly" now (as far as I will ever know anyway lol).</description>
      <pubDate>Mon, 28 Sep 2020 11:04:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282802#M4990</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T11:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282803#M4991</link>
      <description>&lt;BLOCKQUOTE&gt;Braza wrote:&lt;BR /&gt;Did you try to put the REQUEST on the Master Script? Or even in the Parameter Script?&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;Moonlight wrote:&lt;BR /&gt;copied from REQUEST OPTIONS &amp;gt; Request Parameter Script Compatibility &amp;gt; Page 481&lt;BR /&gt;
ie: it means, that using request in Parameter Script or in Master Script were it's part of the script is being interpreted as Parameter Script will cause trouble&lt;/BLOCKQUOTE&gt;
 &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_redface.gif" style="display : inline;" /&gt; My bad.&lt;BR /&gt;
Perhaps my GDL kung fu is kind of "freestyle".  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_mrgreen.gif" style="display : inline;" /&gt;&lt;BR /&gt;
Thanks guys for the info.</description>
      <pubDate>Mon, 28 Sep 2020 17:23:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282803#M4991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using returned request parameters in IF statements</title>
      <link>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282804#M4992</link>
      <description>&lt;BLOCKQUOTE&gt;Moonlight wrote:&lt;BR /&gt;
&lt;FONT color="#000000"&gt;@MICHAEL ISERIEF&lt;BR /&gt;
&lt;BR /&gt;
Using requests or any of their versions, and I quote from ArchiCAD's 23 GDL Reference Guide
&lt;BLOCKQUOTE&gt;
&lt;COLOR color="#000000"&gt;Compatibility up to ARCHICAD 19: The use of most requests in parameter scripts (or master scripts run as parameter script) could result in unreliable returned values.&lt;/COLOR&gt;
&lt;/BLOCKQUOTE&gt;&lt;COLOR color="#000000"&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;copied from REQUEST OPTIONS &amp;gt; Request Parameter Script Compatibility &amp;gt; Page 481&lt;E&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
ie: it means, that using request in Parameter Script or in Master Script were it's part of the script is being interpreted as Parameter Script will cause trouble&lt;/COLOR&gt;
&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;&lt;COLOR color="#000000"&gt;&lt;BR /&gt;
&lt;BR /&gt;
ASSOCLP_PARVALUE is ok to use in the parameter and master script, check page 482.&lt;BR /&gt;
&lt;IMG src="https://www.dropbox.com/s/m8gbn84ynbqj5nk/ASSOCLP.png?dl=0" /&gt;&lt;/COLOR&gt;</description>
      <pubDate>Tue, 29 Sep 2020 01:02:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Using-returned-request-parameters-in-IF-statements/m-p/282804#M4992</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2020-09-29T01:02:03Z</dc:date>
    </item>
  </channel>
</rss>

