marty72

Combining 2 Variables in a Script

Discussion created by marty72 on Apr 20, 2016
Latest reply on Apr 22, 2016 by marty72

I have a loop in a script where I am trying to combine the values of two variables but I am having trouble with the syntax (see attached or below).

I have one set of variables called $spc1, $spc2, $spc3, etc. set to a text values ("PW", "PR", etc.)

I have another variable called $counter set to a numeric value that is incremented inside of a loop (1, 2, etc.).

I am trying to increment the number value in the first variable by using the $counter variable in the loop.

Inside of the loop I am trying to set a 3rd variable called $spcloop to be a combination of $spc1 and $counter so that $spcloop becomes PW, PR, etc as it moves through the loops.

I tried the following without success:

Set Variable [$spcloop: Value: $&"spc"&"$counter"]

Set Variable [$spcloop: Value: $&"spc"&$counter]

Set Variable [$spcloop: Value: $&"spc$counter"]

Any assistance would be appreciated.

Thanx.

Marty

 

Combining Variable in Script.png

Outcomes