Design forum
Showing results for 
Search instead for 
Did you mean: 

Refer to parameters within if statement

Not applicable

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 something....
else something else....
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?

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

-- since v8.1 --
AC22 6025 INT Full | macOS Mojave 10 | 3.2 GHz Intel Xeon W | 32 Gb RAM | Radeon Pro Vega 56 8 Gb

Didn't find the answer? Start a new discussion


Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!