2025-10-22 02:51 PM
I am having a bit of bother with an old GDL object I made years ago.
Its a simple object with various screw and fixing types. Each type is on a Fragment. I have added to Fragment 16 a new screw type and I have added it to the Parameter section of the object so the User can choose whichever fixing type they want.
Problem is I am getting the following error...
Keywords can't be used as variables at line 1
Below are the VALUES but I'm not spotting which one is a "key word"
VALUES "fixtype" "screw" , "expansion bolt" , "bolt head", "bolt side elev", "BG-screw-40mm", "BG-screw-25mm", "MF Panhead", "Screw rawlplug", "Tek Screw", "Self Tap", "Pop Rivet", "Hex Head", "Insulation Dowel", "Self Tap Hex Head", "MF Pan Head Elev",
IF fixtype="screw" THEN Gosub 1
Etc...
Anyone able to spot where it is going wrong?
Thanks
Graeme
Windows 11 ArchiCAD 28.3.0 (earliest version used ArchiCAD 3.4)
Solved! Go to Solution.
2025-10-22 04:55 PM
You have a trailing comma in the end of your "VALUES" command.
This the list spills over to the "IF", which of course is a reserved keyword. This is also why this is still counted as line 1.
2025-10-22 03:03 PM
Salut,
"MF Pan Head Elev" !!!!,
2025-10-22 04:06 PM
Salut,
I've tried changing the variable name to "fixtyp" but no luck. I've also reverted the object back to only use 15 FRAGMENTS but again it is still not liking it.
I blame Windows 11 which I upgraded to yesterday 🙂
2025-10-22 04:54 PM
You must remove the last comma "," after the "MF Pan Head Elev"
2025-10-22 04:55 PM
You have a trailing comma in the end of your "VALUES" command.
This the list spills over to the "IF", which of course is a reserved keyword. This is also why this is still counted as line 1.
2025-10-27 03:32 PM
Thanks, sorted now 👍
Plus I also discovered the limit of 256 characters was breached as well so had to shorten the names to make it happy again.
G
2025-10-27 03:35 PM
No need, after a comma you can go into the next line without trouble. I would even recommend that.
Nobody likes long lines.
And if you need to go to a new line somwhere where a comma is not allowed, you can just use the backslash instead.
2025-10-28 09:47 AM
You can use Array as a list of values. Ir clear to read and manage count and order. Also If You'd like to change list conditionally
dim names[]:i=1
names[i] = "screw" :i=i+1
names[i] = "expansion bolt" :i=i+1
names[i] = "bolt head" :i=i+1
names[i] = "bolt side elev" :i=i+1
names[i] = "BG-screw-40mm" :i=i+1
names[i] = "BG-screw-25mm" :i=i+1
names[i] = "MF Panhead" :i=i+1
names[i] = "Screw rawlplug" :i=i+1
names[i] = "Tek Screw" :i=i+1
names[i] = "Self Tap" :i=i+1
names[i] = "Pop Rivet" :i=i+1
names[i] = "Hex Head" :i=i+1
names[i] = "Insulation Dowel" :i=i+1
names[i] = "Self Tap Hex Head" :i=i+1
names[i] = "MF Pan Head Elev" :i=i+1
VALUES "fixtype" names