passing variable from command line

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
sunole
Newbie
Posts: 14
Joined: Wed Aug 29, 2007 6:28 pm

passing variable from command line

Post by sunole » Wed Dec 03, 2008 2:28 am

I am trying to check if a variable exists since it has being passed from the command line, but the string that gets checked against it self and the logic result is always true

if>%dest%true
Endif

In the above you get true because dest%dest%=""
MessageModal>true
Endif

it is false because dest""
this might be obvious, but what would be a simple check if a variable exists??

also what if a variable is passed through the command line, what would be and easy way to find the name of the variables?? is it manual text find in COMMAND_LINE??? or any other way? thanks in advance.

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

Assigned and MACRO_PARMS

Post by gdyvig » Wed Dec 03, 2008 3:57 am

If you do not know the names and values of the parameters passed in, use system variable MACRO_PARMS.

MessageModal>Parms:%MACRO_PARMS%

If you know the name of a variable you plan to use, use the function Assigned to determine if it is already in use.

Assigned>dest,destAssigned
MessageModal>%destAssigned%

MessageModal should display True if dest is an existing variable or False if it is not.

Gale

sunole
Newbie
Posts: 14
Joined: Wed Aug 29, 2007 6:28 pm

that worked

Post by sunole » Thu Dec 04, 2008 7:48 pm

thank you for your help, that worked well,
the results were all capital TRUE and FALSE ;-)

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