Trouble with assigning a string to an array

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Trouble with assigning a string to an array

Post by JRL » Tue Feb 22, 2011 3:06 pm

If I do:

Code: Select all

Let>counter=7
Let>user_%counter%=something
I get variable user_7 with a value of "something"

If I do:

Code: Select all

Let>counter=7
Let>user_%counter%={"something"}
I get a variable user_%counter% with a value of "something"

Is that correct? As long as "Something" has no value, should the two statements not be equivalent?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Feb 22, 2011 4:43 pm

Your desribed anomaly happens here.
It seems the {} confuse MS parsing.
Here is how I circumvent the anoamly:
Let>i=7
Let>x={"something"}
Let>t%i%=%x%
MDL>t%i%

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts