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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waifor failing !! sometimes !! 1

Status
Not open for further replies.

MotoP

Technical User
Jan 30, 2006
4
GB
The problem I have is the waitfor is not always firing, or sometimes not being seen. I have tried the default (30), I have increased this to 50 and up.... but this doesn't seem to help. It dosen't see it always! It seems that the reply back is sometimes tooooo fast or a bit slow.
If I make this FOREVER it works all the time but the problem then it could hang if "for some reason" the waitfor text was incorrect. I need to keep checking every line and fail if this was not what was expected.
Help ! Am I doing something wrong?
;--------------------
Telnet_connect (IP1)

waitfor "login: " ;Check if able to log on
mess = "Unable to log onto "
Failure_Condition (mess)

transmit Uname[0]
waitfor "Password: "
mess = "User Name incorrect "
Failure_Condition (mess)
transmit Pass[0]


waitfor "Enter Selection: (1-8, q, ?) [q]>"
mess = "Password incorrect "
Failure_Condition (mess)
;-----
proc Failure_Condition
param string mess
integer statcond

if FAILURE
usermsg mess
writelogfile(mess)
statcond = 1
longjmp 0 statcond
else
endif
endproc
 
Which waitfor is failing? If it is the "Enter Selection: (1-8, q, ?) [q]>" string, then I would shorten it so the string has less chances of being corrupted, missing characters, etc.

 
Thanks knob ....

That helped, had to shorten it to (1-8,. I am also doing a lot of backgroud stuff so proceesor time is another problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top