<?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 Uninitilaized variable Error Message on VARDIM1 and VARDIM2 in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Uninitilaized-variable-Error-Message-on-VARDIM1-and-VARDIM2/m-p/158696#M17378</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I think this is a bug of the GDL program that produce this error message when using the VARDIM functions. I find it very annoying when running the check script.&lt;BR /&gt;
&lt;BR /&gt;
! Example from GDL Reference Guide Page 237&lt;BR /&gt;
DIM f1 [5]&lt;BR /&gt;
FOR i = 1 TO VARDIM1(f1)    ! &lt;FONT color="red"&gt;Uninitialized variable Error Message here&lt;/FONT&gt; &lt;BR /&gt;
    f1 &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = i&lt;BR /&gt;
NEXT i&lt;BR /&gt;
&lt;BR /&gt;
But if I do this, the Error Message will not come up:&lt;BR /&gt;
&lt;BR /&gt;
DIM f1 [5]&lt;BR /&gt;
f1[1] = 0&lt;BR /&gt;
f1[2] = 0&lt;BR /&gt;
f1[3] = 0&lt;BR /&gt;
f1[4] = 0&lt;BR /&gt;
f1[5] = 0&lt;BR /&gt;
&lt;BR /&gt;
FOR i = 1 TO VARDIM1(f1)    &lt;BR /&gt;
    f1 &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = i&lt;BR /&gt;
NEXT i&lt;BR /&gt;
&lt;BR /&gt;
Is there any way to overcome this problem ?&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Hoa&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Jan 2011 05:09:24 GMT</pubDate>
    <dc:creator>Hoa Tu</dc:creator>
    <dc:date>2011-01-12T05:09:24Z</dc:date>
    <item>
      <title>Uninitilaized variable Error Message on VARDIM1 and VARDIM2</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Uninitilaized-variable-Error-Message-on-VARDIM1-and-VARDIM2/m-p/158696#M17378</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I think this is a bug of the GDL program that produce this error message when using the VARDIM functions. I find it very annoying when running the check script.&lt;BR /&gt;
&lt;BR /&gt;
! Example from GDL Reference Guide Page 237&lt;BR /&gt;
DIM f1 [5]&lt;BR /&gt;
FOR i = 1 TO VARDIM1(f1)    ! &lt;FONT color="red"&gt;Uninitialized variable Error Message here&lt;/FONT&gt; &lt;BR /&gt;
    f1 &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = i&lt;BR /&gt;
NEXT i&lt;BR /&gt;
&lt;BR /&gt;
But if I do this, the Error Message will not come up:&lt;BR /&gt;
&lt;BR /&gt;
DIM f1 [5]&lt;BR /&gt;
f1[1] = 0&lt;BR /&gt;
f1[2] = 0&lt;BR /&gt;
f1[3] = 0&lt;BR /&gt;
f1[4] = 0&lt;BR /&gt;
f1[5] = 0&lt;BR /&gt;
&lt;BR /&gt;
FOR i = 1 TO VARDIM1(f1)    &lt;BR /&gt;
    f1 &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = i&lt;BR /&gt;
NEXT i&lt;BR /&gt;
&lt;BR /&gt;
Is there any way to overcome this problem ?&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
Hoa&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Jan 2011 05:09:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Uninitilaized-variable-Error-Message-on-VARDIM1-and-VARDIM2/m-p/158696#M17378</guid>
      <dc:creator>Hoa Tu</dc:creator>
      <dc:date>2011-01-12T05:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Uninitilaized variable Error Message on VARDIM1 and VARD</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Uninitilaized-variable-Error-Message-on-VARDIM1-and-VARDIM2/m-p/158697#M17379</link>
      <description>&lt;BLOCKQUOTE&gt;"From the GDL manual wrote:&lt;BR /&gt;VARDIM1(expr)&lt;BR /&gt;
VARDIM1(expr)&lt;BR /&gt;
VARDIM2(expr)&lt;BR /&gt;
VARDIM2(expr)&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&lt;BR /&gt;
to handle correctly all actual elements of a dynamic array or an array parameter. &lt;FONT color="#ff001b"&gt;If no element of a dynamic array was previously set, the return&lt;BR /&gt;
value is 0&lt;/FONT&gt;. For one-dimensional arrays VARDIM2 returns 0.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
So you are saying to go &lt;FONT color="#ff0012"&gt;FOR i = 1 to 0&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
But in you second part of the example you have given values to tha array so it now works.&lt;BR /&gt;
&lt;BR /&gt;
Why don't you just say ...&lt;BR /&gt;
FOR i = 1 TO 5 &lt;BR /&gt;
f1 &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt; = i &lt;BR /&gt;
NEXT i &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 12 Jan 2011 05:26:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Uninitilaized-variable-Error-Message-on-VARDIM1-and-VARDIM2/m-p/158697#M17379</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2011-01-12T05:26:43Z</dc:date>
    </item>
  </channel>
</rss>

