<?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: Could anyone give quick lesson on arrays? (length of arr in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199702#M12129</link>
    <description>Thank you, Juha.&lt;BR /&gt;
I eventually reached the part of GDL manual where they explain how to build arrays. Let me explain myself a bit more:&lt;BR /&gt;
See the attached screenshot with an array called myarray[4]&lt;BR /&gt;
&lt;BR /&gt;
My question is: I don't want to hard code the number in brackets. It can be [4] or [1] or [52] but I do not know how to pass it to my FOR loop without hard coding it, because I'd like my users to add or delete as many rows as they want. &lt;BR /&gt;
&lt;BR /&gt;
Is this possible at all...?&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/37315iF4C0B7ACCB5208A9/image-size/large?v=v2&amp;amp;px=999" border="0" alt="array_length.jpg" title="array_length.jpg" /&gt;</description>
    <pubDate>Wed, 13 Aug 2014 18:09:32 GMT</pubDate>
    <dc:creator>matjashka</dc:creator>
    <dc:date>2014-08-13T18:09:32Z</dc:date>
    <item>
      <title>Could anyone give quick lesson on arrays? (length of array)</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199698#M12125</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I read a few really good threads on arrays, but I'm still a bit confused.&lt;BR /&gt;
&lt;BR /&gt;
Simple concept: I need to CALL an object a few times at user-defined spaces given in 1-dimensional array.&lt;BR /&gt;
User manually inserts N amount of fields in an array in Object Parameters, like:&lt;BR /&gt;
1'-0"&lt;BR /&gt;
2'-8"&lt;BR /&gt;
13'-6"&lt;BR /&gt;
...and so forth&lt;BR /&gt;
&lt;BR /&gt;
I'd like to use a FOR loop that inserts the CALLed object N times at specific intervals. Is this the correct approach? Thank you!&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Aug 2014 23:45:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199698#M12125</guid>
      <dc:creator>matjashka</dc:creator>
      <dc:date>2014-08-12T23:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199699#M12126</link>
      <description>Tip:&lt;BR /&gt;
nSpaces=0    !conts add commands&lt;BR /&gt;
for kont=1 to N do&lt;BR /&gt;
   add arrayName[kont], 0.000, 0.000&lt;BR /&gt;
       call callName&lt;BR /&gt;
       nSpaces=nSpaces+1&lt;BR /&gt;
next kont&lt;BR /&gt;
del nSpaces</description>
      <pubDate>Wed, 13 Aug 2014 08:45:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199699#M12126</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-13T08:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199700#M12127</link>
      <description>Ilder,&lt;BR /&gt;
Thank you,&lt;BR /&gt;
if I'm understanding your response correctly, the basic loop example you shared with me assumes that N is a pre-defined number. &lt;BR /&gt;
That's not the case -- I would like N to be automatically generated based on number of rows in the array when the array is parsed. How do I make the GDL engine return that number?&lt;BR /&gt;
1) Parse the array&lt;BR /&gt;
2) Calculate N of array elements in a column&lt;BR /&gt;
3) for i=1 to N space objects at defined values&lt;BR /&gt;
&lt;BR /&gt;
Next time the user adds or deletes a row, N is re-calculated. I'm sure it's simple, I'm just missing that bit.</description>
      <pubDate>Wed, 13 Aug 2014 15:11:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199700#M12127</guid>
      <dc:creator>matjashka</dc:creator>
      <dc:date>2014-08-13T15:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays? (length of arr</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199701#M12128</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
You can declare dynamic arrays just using
&lt;PRE&gt;dim xxx[]&lt;/PRE&gt;
or
&lt;PRE&gt;dim yyy[][]&lt;/PRE&gt;

The variables vardim1() and vardim2() return the array length&lt;BR /&gt;
&lt;BR /&gt;
For example
&lt;PRE&gt;rows= vardim1(xxx)&lt;/PRE&gt;
or 
&lt;PRE&gt;columns= vardim2(xxx)&lt;/PRE&gt;

Hope this helps.</description>
      <pubDate>Wed, 13 Aug 2014 17:22:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199701#M12128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-13T17:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays? (length of arr</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199702#M12129</link>
      <description>Thank you, Juha.&lt;BR /&gt;
I eventually reached the part of GDL manual where they explain how to build arrays. Let me explain myself a bit more:&lt;BR /&gt;
See the attached screenshot with an array called myarray[4]&lt;BR /&gt;
&lt;BR /&gt;
My question is: I don't want to hard code the number in brackets. It can be [4] or [1] or [52] but I do not know how to pass it to my FOR loop without hard coding it, because I'd like my users to add or delete as many rows as they want. &lt;BR /&gt;
&lt;BR /&gt;
Is this possible at all...?&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/37315iF4C0B7ACCB5208A9/image-size/large?v=v2&amp;amp;px=999" border="0" alt="array_length.jpg" title="array_length.jpg" /&gt;</description>
      <pubDate>Wed, 13 Aug 2014 18:09:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199702#M12129</guid>
      <dc:creator>matjashka</dc:creator>
      <dc:date>2014-08-13T18:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays? (length of arr</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199703#M12130</link>
      <description>Hello,&lt;BR /&gt;
Do not know if this is the case - just one &lt;BR /&gt;
example getting values from one array to&lt;BR /&gt;
another&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;!--value or master script
dim xxx[]
n= 0

for i = 1 to vardim1(myarray)
  if myarray&lt;I&gt; &amp;gt; 0 then   !--filter what is included to the array 'xxx'
    n= n+1
    xxx&lt;N&gt; = myarray&lt;I&gt;
  endif
next i

!--make it a value list
values 'mylist' xxx
&lt;/I&gt;&lt;/N&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Aug 2014 18:45:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199703#M12130</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-13T18:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays? (length of arr</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199704#M12131</link>
      <description>&lt;BLOCKQUOTE&gt;Juha wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;for i = 1 to vardim1(myarray)
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;

&lt;BLOCKQUOTE&gt;GDL wrote:&lt;BR /&gt;These functions return as integers the actual dimension values for the (array) expression specified as a parameter. They must be used if you want to handle correctly all actual elements of a dynamic array or an array parameter.&lt;/BLOCKQUOTE&gt;

Awesome - *this* is exactly what I was looking for. I saw vardim1 in the manual, but didn't really know how it applied to my problem.&lt;BR /&gt;
&lt;BR /&gt;
THANK YOU very much, Juha!</description>
      <pubDate>Wed, 13 Aug 2014 19:34:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199704#M12131</guid>
      <dc:creator>matjashka</dc:creator>
      <dc:date>2014-08-13T19:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Could anyone give quick lesson on arrays? (length of arr</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199705#M12132</link>
      <description>There is a very good discussion of &lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=30992&amp;amp;postdays=0&amp;amp;postorder=asc&amp;amp;highlight=dynamic+array+control&amp;amp;&amp;amp;start=0" target="_blank"&gt;array sizing with examples here too.&lt;/A&gt;</description>
      <pubDate>Wed, 13 Aug 2014 20:59:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Could-anyone-give-quick-lesson-on-arrays-length-of-array/m-p/199705#M12132</guid>
      <dc:creator>Erich</dc:creator>
      <dc:date>2014-08-13T20:59:37Z</dc:date>
    </item>
  </channel>
</rss>

