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

Evaluate a variable when you know its name

Anonymous
Not applicable
There are some gdl statements that ask you to provide the name of the variable as a string. That is very usefull some times,because you can create the name of the variable at run-time by a for-next loop

Now my question is. Can i get the content of a variable by providing its name?

For example i a have for next loop creating the string variable1,variable2,...variableI, which are a series of global parameters (i dont want to use arrays for some reasons) Now can i get somehow the content of the variableI?
I can for example say HIDEPARAMETERS "variable1"
Is there a way to say smthg like EVALUATE "variable1"?

(in case the answer is negative.. i think i have to add it to the wish list. Arrays are nice, but i some times you want the user to see it the usual way..)
2 REPLIES 2
Laszlo Nagy
Community Admin
Community Admin
You might want to check the following GDL commands:

REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)

REQUEST ("ASSOCLP_NAME", "", name)

They might do something like what you want to achieve.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
Anonymous
Not applicable
thx a lot