cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Refer to parameters within if statement

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
Advisor
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
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!