VARTYPE line error
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-11-24 11:33 AM
2017-11-24
11:33 AM
I don't know what's causing it or how to fix it.
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 > 0 AND VARTYPE (var) = 2 THEN sarray= var j = j + 1 ENDIF i = i + 1 WHILE n > 0 CLOSE ch1 ! parameter popup with strings read from the file VALUES "RefNote" sarray
ArchiCAD 27
Windows 10
Windows 10
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-11-25 08:35 AM
2017-11-25
08:35 AM
Works with me. Check parameter "RefNote" in the parameters' tab, it's type should be text.
-The text file must be in the loaded library.It must not be opened in any other application at the same time.
-The text file must be in the loaded library.It must not be opened in any other application at the same time.
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-11-25 08:55 PM
2017-11-25
08:55 PM
JGoode wrote:Create var parameter, or declare var = 0 in the script. And there will be no mistakes.
I keep getting an error on the "IF n > 0 AND VARTYPE (var) = 2 THEN" line
I don't know what's causing it or how to fix it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-11-30 07:51 AM
2017-11-30
07:51 AM
If the input is not successful, then vartype will be uninitialized. So you should split it to two conditions:
if n > 0 then if vartype (var) = 2 then ...
_________________
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE