Help with "Input>" command

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Guest

Help with "Input>" command

Post by Guest » Thu Aug 26, 2004 9:43 pm

I am using the Input function and need to handle a couple events.

First, if someone does not enter anything in the Input box and clicks OK, I would like the script to go to some label (End in this case). I tried using:

Code: Select all

If>%Incident%=NULL,End
But this is not working and the script just continues from that point. I also replaced NULL with "" but this didn't work either. How do I validate that input is not NULL?

Second, how do I handle cancel? I would like to go to a label (End in this case but that may change). I used a message> to see what my %Incident% variable is on the cancel event but it seems as though it's NULL. Is there a way to determine if the cancel is selected rather than looking for null (which I couldn't figure out above anyway)?

Here is a complete example of this section of the script:

Code: Select all

Input>Incident,Please enter your incident number
If>%Incident%=NULL,End
Label>Check
IfDirExists>c:\mpm30\sys\%Incident%,Open
Ask>Folder does not exist.%CRLF%%CRLF%Do you want to create this folder?%CRLF%%CRLF%c:\mpm30\sys\%Incident%,continue
If>continue=YES,Create,End
Label>Create
CreateDir>c:\mpm30\sys\%Incident%
Label>Open
Run Program>Explorer c:\mpm30\sys\%Incident%
Label>End
Thanks in advance for your help!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Aug 26, 2004 10:00 pm

Macro Scheduler uses exact values, no delimiters, punctuation, etc.
If %Incident% or any other variable is checked, just leave a blank after the = sign. Do not insert a space, it will be taken literally as a space character. Modifed script is shown below:
Input>Incident,Please enter your incident number
If>%Incident%=,End
Label>Check
IfDirExists>c:\mpm30\sys\%Incident%,Open
Ask>Folder does not exist.%CRLF%%CRLF%Do you want to create this folder?%CRLF%%CRLF%c:\mpm30\sys\%Incident%,continue
If>%continue%=YES,Create,End
Label>Create
CreateDir>c:\mpm30\sys\%Incident%
Label>Open
Run Program>Explorer c:\mpm30\sys\%Incident%
Label>End
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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