<?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: GDL: Array Parameter Defaulting to Zero in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/383321#M307</link>
    <description>&lt;P&gt;Might it be related to:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;During the interpretation, when a non-existing dynamic array element is given a value, the necessary quantity of memory&lt;BR /&gt;is allocated and the missing elements are all set to 0 (numerical).&lt;/BLOCKQUOTE&gt;
&lt;P class="1686638639936"&gt;Though only these two arrays are doing it...&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 06:53:17 GMT</pubDate>
    <dc:creator>Lingwisyer</dc:creator>
    <dc:date>2023-06-13T06:53:17Z</dc:date>
    <item>
      <title>GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381469#M302</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea why the following is only changing the size of the&amp;nbsp;&lt;STRONG&gt;sg_gridToggle&amp;nbsp;&lt;/STRONG&gt;&amp;amp;&amp;nbsp;&lt;STRONG&gt;sg_lengthToggle&lt;/STRONG&gt; arrays and not their values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;IF sg_noStoreyAbove &amp;gt; sg_noBasement then
			sizetokeep = min(vardim1(sg_customName), sg_noStoreyAbove)
		
			! copy existing values
			dim sg_lengthCustom_temp[][]
			dim sg_lengthCustom2_temp[][]
			dim sg_lengthToggle_temp[][]
			dim sg_gridToggle_temp[][]
			dim sg_gridToggle_display_temp[][]
			dim lp1_temp[][]
			dim lp2_h_temp[][]
			dim lp2_v_temp[][]
			dim marker_flip_temp[][]
			dim marker_flip_display_temp[][]
			for i = 1 to sizetokeep
				sg_lengthCustom_temp[i][1]			= sg_lengthCustom[i][1]
				sg_lengthCustom_temp[i][2]			= sg_lengthCustom[i][2]
				sg_lengthCustom2_temp[i][1]			= sg_lengthCustom2[i][1]
				sg_lengthCustom2_temp[i][2]			= sg_lengthCustom2[i][2]
				sg_lengthToggle_temp[i][1]			= sg_lengthToggle[i][1]
				sg_lengthToggle_temp[i][2]			= sg_lengthToggle[i][2]
				sg_gridToggle_temp[i][1]			= sg_gridToggle[i][1]
				sg_gridToggle_temp[i][2]			= sg_gridToggle[i][2]
				sg_gridToggle_display_temp[i][1]	= sg_gridToggle_display[i][1]
				sg_gridToggle_display_temp[i][2]	= sg_gridToggle_display[i][2]
				lp1_temp[i][1]						= lp1[i][1]
				lp1_temp[i][2]						= lp1[i][2]
				lp1_temp[i][3]						= lp1[i][3]
				lp1_temp[i][4]						= lp1[i][4]
				lp2_h_temp[i][1]					= lp2_h[i][1]
				lp2_h_temp[i][2]					= lp2_h[i][2]
				lp2_h_temp[i][3]					= lp2_h[i][3]
				lp2_h_temp[i][4]					= lp2_h[i][4]
				lp2_v_temp[i][1]					= lp2_v[i][1] 
				lp2_v_temp[i][2]					= lp2_v[i][2]
				lp2_v_temp[i][3]					= lp2_v[i][3]
				lp2_v_temp[i][4]					= lp2_v[i][4]
				marker_flip_temp[i][1]				= marker_flip[i][1]
				marker_flip_temp[i][2]				= marker_flip[i][2]
				marker_flip_display_temp[i][1]		= marker_flip_display[i][1]
				marker_flip_display_temp[i][2]		= marker_flip_display[i][2]
			next i
		
			! initialize new values, will be skipped when decreasing size
			for i = sizetokeep + 1 to sg_noStoreyAbove
				sg_lengthCustom_temp[i][1]			= sg_length
				sg_lengthCustom_temp[i][2]			= 0
				sg_lengthCustom2_temp[i][1]			= 0
				sg_lengthCustom2_temp[i][2]			= 0
				sg_lengthToggle_temp[i][1]			= 1
				sg_lengthToggle_temp[i][2]			= 1
				sg_gridToggle_temp[i][1]			= 1
				sg_gridToggle_temp[i][2]			= 1
				sg_gridToggle_display_temp[i][1]	= "Show"
				sg_gridToggle_display_temp[i][2]	= "Show"
				lp1_temp[i][1]						= marker_length/4
				lp1_temp[i][2]						= marker_length/4
				lp1_temp[i][3]						= marker_length/4
				lp1_temp[i][4]						= marker_length/4
				lp2_h_temp[i][1]					= marker_length/4
				lp2_h_temp[i][2]					= marker_length/4
				lp2_h_temp[i][3]					= marker_length/4
				lp2_h_temp[i][4]					= marker_length/4
				lp2_v_temp[i][1]					= 0
				lp2_v_temp[i][2]					= 0
				lp2_v_temp[i][3]					= 0
				lp2_v_temp[i][4]					= 0
				marker_flip_temp[i][1]				= 1
				marker_flip_temp[i][2]				= 1
				marker_flip_display_temp[i][1]		= "Top"
				marker_flip_display_temp[i][2]		= "Top"
			next i
		
			! store array with new size
			sg_lengthCustom							= sg_lengthCustom_temp
			sg_lengthCustom2						= sg_lengthCustom2_temp
			sg_lengthToggle							= sg_lengthToggle_temp
			sg_gridToggle							= sg_gridToggle_temp
			sg_gridToggle_display					= sg_gridToggle_display_temp
			lp1										= lp1_temp
			lp2_h									= lp2_h_temp
			lp2_v									= lp2_v_temp
			marker_flip								= marker_flip_temp
			marker_flip_display						= marker_flip_display_temp
			parameters sg_lengthCustom				= sg_lengthCustom
			parameters sg_lengthCustom2				= sg_lengthCustom2
			parameters sg_lengthToggle				= sg_lengthToggle
			parameters sg_gridToggle				= sg_gridToggle
			parameters sg_gridToggle_display		= sg_gridToggle_display
			parameters lp1							= lp1
			parameters lp2_h						= lp2_h
			parameters lp2_v						= lp2_v
			parameters marker_flip					= marker_flip
			parameters marker_flip_display			= marker_flip_display
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Snippet from &lt;A href="https://community.graphisoft.com/t5/Documentation/Level-Marking-in-Section-and-Elevation-for-a-Site-with-Multiple/td-p/373933" target="_self"&gt;this object&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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>Fri, 26 May 2023 04:45:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381469#M302</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-05-26T04:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381573#M303</link>
      <description>&lt;P&gt;You might want to add ;&lt;/P&gt;
&lt;P&gt;sg_gridToggle = sg_gridToggle_temp&lt;/P&gt;
&lt;P&gt;before ;&lt;/P&gt;
&lt;P&gt;parameters sg_gridToggle = sg_gridToggle&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 00:53:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381573#M303</guid>
      <dc:creator>Palawat</dc:creator>
      <dc:date>2023-05-27T00:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381582#M304</link>
      <description>&lt;P&gt;You could try resetting the parameter values with an empty array e.g.&lt;/P&gt;
&lt;P&gt;Dim arrNull2 [1] [1]&lt;/P&gt;
&lt;P&gt;arrNull2 [1] [1] = "initial value"&lt;/P&gt;
&lt;P&gt;oldarray = arrNull2&lt;/P&gt;
&lt;P&gt;parameters oldarray = oldarray&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have situations where my parameter arrays wouldn't downsize and rebuilding from an empty array seemed to cure it.&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 10:55:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381582#M304</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2023-05-28T10:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381658#M305</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/12494"&gt;@Palawat&lt;/a&gt;&amp;nbsp;You might want to add ;&lt;/P&gt;
&lt;P&gt;sg_gridToggle = sg_gridToggle_temp&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That was done just a few lines above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/11396"&gt;@DGSketcher&lt;/a&gt;&amp;nbsp;You could try resetting the parameter values with an empty array e.g.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Isn't that what&amp;nbsp;&lt;EM&gt;DIM sg_gridToggle_temp[ ][ ]&lt;/EM&gt; does? Or is there something else I should be doing?&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, 29 May 2023 02:02:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381658#M305</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-05-29T02:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381697#M306</link>
      <description>&lt;P&gt;I started doing that in order to force the original dynamic parameter array to shrink before repopulating it with updated values. Maybe Parameter Arrays are processed differently to simple variable arrays. Sorry I'm not a GDL expert and my solutions usually come from trial &amp;amp; error.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 09:24:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/381697#M306</guid>
      <dc:creator>DGSketcher</dc:creator>
      <dc:date>2023-05-29T09:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/383321#M307</link>
      <description>&lt;P&gt;Might it be related to:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;During the interpretation, when a non-existing dynamic array element is given a value, the necessary quantity of memory&lt;BR /&gt;is allocated and the missing elements are all set to 0 (numerical).&lt;/BLOCKQUOTE&gt;
&lt;P class="1686638639936"&gt;Though only these two arrays are doing it...&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 06:53:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/383321#M307</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-06-13T06:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: GDL: Array Parameter Defaulting to Zero</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/383569#M308</link>
      <description>&lt;P&gt;Hm... I partially fixed it... I realised that since I had combined the up and down arrays [&lt;FONT face="times new roman,times"&gt;u&lt;/FONT&gt;][&lt;FONT face="times new roman,times"&gt;d&lt;/FONT&gt;] the values between the short and tall sides [&lt;FONT face="times new roman,times"&gt;u&lt;/FONT&gt;][&lt;FONT face="times new roman,times"&gt;u&lt;/FONT&gt;-&lt;FONT face="times new roman,times"&gt;x&lt;/FONT&gt;] were not getting set in the short side of the array [&lt;FONT face="times new roman,times"&gt;u&lt;/FONT&gt;-&lt;FONT face="times new roman,times"&gt;d&lt;/FONT&gt;]. This was an easy enough fix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;sg_lengthToggle_temp[i][1]			= sg_lengthToggle[i][1]
sg_gridToggle_temp[i][1]			= sg_gridToggle[i][1]
sg_gridToggle_display_temp[i][1]	= sg_gridToggle_display[i][1]
IF i &amp;gt; sg_noBasement then
		sg_gridToggle_temp[i][2]			= sg_Toggle_default
		sg_gridToggle_display_temp[i][2]	= "Show"
		sg_lengthToggle_temp[i][2]			= sg_Toggle_default
	else
		sg_gridToggle_temp[i][2]			= sg_gridToggle[i][2]
		sg_gridToggle_display_temp[i][2]	= sg_gridToggle_display[i][2]
		sg_lengthToggle_temp[i][2]			= sg_lengthToggle[i][2]
endIF

...

========================================================================================

...

IF i &amp;gt; sg_noStoreyAbove then
		sg_gridToggle_temp[i][1]			= sg_Toggle_default
		sg_gridToggle_display_temp[i][1]	= "Show"
		sg_lengthToggle_temp[i][1]			= sg_Toggle_default
	else
		sg_gridToggle_temp[i][1]			= sg_gridToggle[i][1]
		sg_gridToggle_display_temp[i][1]	= sg_gridToggle_display[i][1]
		sg_lengthToggle_temp[i][1]			= sg_lengthToggle[i][1]
endIF
sg_lengthToggle_temp[i][2]			= sg_lengthToggle[i][2]
sg_gridToggle_temp[i][2]			= sg_gridToggle[i][2]
sg_gridToggle_display_temp[i][2]	= sg_gridToggle_display[i][2]
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was hoping my issue with increasing the overall array size would be solved in a similar way but this would seem to not be the case... So for [&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;u&lt;/EM&gt;&lt;/FONT&gt;][&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;d&lt;/EM&gt;&lt;/FONT&gt;], increasing &lt;FONT face="times new roman,times"&gt;&lt;EM&gt;d&lt;/EM&gt;&lt;/FONT&gt; until it matches &lt;FONT face="times new roman,times"&gt;&lt;EM&gt;u&lt;/EM&gt;&lt;/FONT&gt;, or viceversa, gives the correct default values, but increasing the max(&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;u&lt;/EM&gt;&lt;/FONT&gt;,&lt;FONT face="times new roman,times"&gt;&lt;EM&gt;d&lt;/EM&gt;&lt;/FONT&gt;), still gives the incorrect return...&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 06:41:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Array-Parameter-Defaulting-to-Zero/m-p/383569#M308</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-06-14T06:41:52Z</dc:date>
    </item>
  </channel>
</rss>

