<?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 VARTYPE line error in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248601#M4532</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I keep getting an error on the "IF n &amp;gt; 0 AND VARTYPE (var) = 2 THEN" line&lt;BR /&gt;
I don't know what's causing it or how to fix it.&lt;BR /&gt;

&lt;PRE&gt;DIM sarray[]
! file in the library, containing parameter data
filename = "ProjectNotes.txt"
ch1 = OPEN ("text", filename, "MODE=RO, LIBRARY")
i = 1
j = 1
sarray[1] = ""
! collect all strings
DO
    n = INPUT (ch1, i, 1, var)
    IF n &amp;gt; 0 AND VARTYPE (var) = 2 THEN
        sarray&lt;J&gt; = var
        j = j + 1
    ENDIF
    i = i + 1
WHILE n &amp;gt; 0
CLOSE ch1
! parameter popup with strings read from the file
VALUES "RefNote" sarray&lt;/J&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 24 Nov 2017 10:33:06 GMT</pubDate>
    <dc:creator>JGoode</dc:creator>
    <dc:date>2017-11-24T10:33:06Z</dc:date>
    <item>
      <title>VARTYPE line error</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248601#M4532</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I keep getting an error on the "IF n &amp;gt; 0 AND VARTYPE (var) = 2 THEN" line&lt;BR /&gt;
I don't know what's causing it or how to fix it.&lt;BR /&gt;

&lt;PRE&gt;DIM sarray[]
! file in the library, containing parameter data
filename = "ProjectNotes.txt"
ch1 = OPEN ("text", filename, "MODE=RO, LIBRARY")
i = 1
j = 1
sarray[1] = ""
! collect all strings
DO
    n = INPUT (ch1, i, 1, var)
    IF n &amp;gt; 0 AND VARTYPE (var) = 2 THEN
        sarray&lt;J&gt; = var
        j = j + 1
    ENDIF
    i = i + 1
WHILE n &amp;gt; 0
CLOSE ch1
! parameter popup with strings read from the file
VALUES "RefNote" sarray&lt;/J&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Nov 2017 10:33:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248601#M4532</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2017-11-24T10:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: VARTYPE line error</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248602#M4533</link>
      <description>Works with me. Check parameter "RefNote" in the parameters' tab, it's type should be text. &lt;BR /&gt;
-The text file must be in the loaded library.It must not be opened in any other application at the same time.</description>
      <pubDate>Sat, 25 Nov 2017 07:35:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248602#M4533</guid>
      <dc:creator>Pertti Paasky</dc:creator>
      <dc:date>2017-11-25T07:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: VARTYPE line error</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248603#M4534</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;I keep getting an error on the "IF n &amp;gt; 0 AND VARTYPE (var) = 2 THEN" line&lt;BR /&gt;
I don't know what's causing it or how to fix it.
&lt;/BLOCKQUOTE&gt;
Create var parameter, or declare var = 0 in the script. And there will be no mistakes.</description>
      <pubDate>Sat, 25 Nov 2017 19:55:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248603#M4534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-25T19:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: VARTYPE line error</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248604#M4535</link>
      <description>If the input is not successful, then vartype will be uninitialized. So you should split it to two conditions:
&lt;PRE&gt;if n &amp;gt; 0 then
    if vartype (var) = 2 then
        ...

&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Nov 2017 06:51:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/VARTYPE-line-error/m-p/248604#M4535</guid>
      <dc:creator>Gergely Feher</dc:creator>
      <dc:date>2017-11-30T06:51:54Z</dc:date>
    </item>
  </channel>
</rss>

