SCRIPT VARIABLE and SCREEN TEXT COLLISION

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Niroj@Work
Pro Scripter
Posts: 63
Joined: Thu Dec 10, 2009 8:13 am

SCRIPT VARIABLE and SCREEN TEXT COLLISION

Post by Niroj@Work » Fri May 28, 2010 5:07 am

Many times the text coming from a screen may be same as the variable name used inside the script. e.g.

// A variable storing a value
Let>TEST=123

// TEST a string coming from the screen; we don't have any control over it..!
Let>var=TEST

// Now if I want to display only TEST not 123 What I need to do?

I tried as below:
Let>VAREXPLICIT=1
Mdl>%var%
Let>VAREXPLICIT=0

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

Post by jpuziano » Fri May 28, 2010 6:14 am

Hi Niroj@Work,

Your easiest solution might be to use very uncommon variable names... so uncommon that there is almost no chance that the variable name itself will ever be encountered in any text you might assign to it.

Check out the following post for a detailed description of what is going on...
Take care
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 - :-)

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Fri May 28, 2010 3:23 pm

Hi,

The problem is with the location of the varexplicits. Try this:

Code: Select all

Let>VAREXPLICIT=1 
// A variable storing a value 
Let>TEST=123 

// TEST a string coming from the screen; we don't have any control over it..! 
Let>var=TEST
//back to default value for varexplicit, if you wish. 
Let>VAREXPLICIT=0 

// Now if I want to display only TEST not 123 What I need to do? 

Note how the variable expansions work in these cases: 
Mdl>%var%
mdl>var
mdl>%TEST%
mdl>TEST
mdl>var:%var%
mdl>TEST:%TEST% 

Gale

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