Using variables question

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Using variables question

Post by Jerry Thomas » Mon Dec 20, 2010 9:11 pm

I know this is an easy question but its Monday morning...

How do I do bracket the variables used in the MDL statement?

Code: Select all

GetWindowList>WinList
Separate>WinList,%CRLF%,List

Let>cnt=2

MDL>Method1:{%List_cnt%}, Method2: {(List_%cnt%)}, Method3: {(%List_%cnt%%)}, Method4: List_%cnt%
Thanks,
Jerry

[email protected]

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

Post by JRL » Tue Dec 21, 2010 3:14 am

The only way I know to do this is to set the array value to a new variable then use that new variable

Code: Select all

GetWindowList>WinList
Separate>WinList,%CRLF%,List

Let>cnt=2
Let>NewVar=List_%cnt%

MDL>%NewVar%

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Dec 21, 2010 4:46 am

Actually, this will work...

Code: Select all

GetWindowList>WinList
Separate>WinList,%CRLF%,List

Let>cnt=2

MDL>List_%cnt%
...however if you should need to include other text in your MDL> statement besides just the variable itself, then you'll have to use the method that JRL has posted above... unless... is there another way Marcus?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Tue Dec 21, 2010 3:13 pm

The combination of regular text and the variable is what was throwing me off. Both of your comments confirm what I had found.

Thanks for the help!
Thanks,
Jerry

[email protected]

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