Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with IF ELSE

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to make the script recognize one of 3 outputs then based on those ouputs goto another proc.

I can get the waitfor down and have it time out in a short time

if waitfor "blah" 10
goto bla ; I forgot what the real goto command

else
goto alb
endif

But that only works for 2 expected outputs, what do I do if I want to goto a specific proc based on several results?
 
Try this structure:

if waitfor "blah" 10
goto blah
elseif waitfor "blahblah" 10
goto blahblah
elseif waitfor "blahblahblah" 10
goto blahblahblah
else
goto alb
endif

Matt
 
Just thought I would add that if all 3 conditions in the
if/elseif/else structure fail then the entire stucture will
take 30 seconds to execute. Not the most efficient code.
You might think about useing the TERMGETS command to
return the waitfor target string from the terminal window
and then evaluating the target string in a SWITCH structure.
Let me know if you need more info.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top