Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Refer to parameters within if statement

Anonymous
Not applicable
Hi!

As a newbie in GDL, I can't get how to get together string and numbers.
My case:

I have parameters: a1, a2, a3, a4, a5 etc... with the same values

I want to create an if statement with all of the parameters, but it doesn't work, I can not create a right script to describe the parameters
for i=1 to 10
if a+str(i) = something then
....build something....
else
....build something else....
endif
next i

if I want to loop with values, it works, but I don't get why, and how to
for i=1 to 10
value "a"+str(i,1,0) param1, param2
next i
can somebody explane it to me?
1 REPLY 1
Bruce
Expert
You can't concatenate variable names like this in GDL (although you can in other languages). To do the same thing, use an array. These are declared using the DIM statement e.g. DIM arrayName[]
Bruce Walker
www.brucepwalker.com
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC26 5002 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb