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!

KNOB NEED YOUR HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!

Status
Not open for further replies.

ok1397

Technical User
Feb 7, 2005
70
US
BELOW IS A SCRIPT TO LOGON USING TELNET, IF IDLE FOR A CERTIAN TIME IT WILL DISCONNECT. OR IF USER TYPES "BYE" IT WILL LOG OFF & DISCONNECT, WORKS GREAT. BUT, I WOULD LIKE TO ALLOW THE USER IF DISCONNECTED AND PROCOMM STILL ON TO BE ABLE TO HIT ESC KEY AND EXIT PROCOMM !!!!! HOW CAN I MAKE THIS WORK, SINCE I ALREADY HAVE A WHEN CONDITION ????
THANK YOU,

proc main
integer iStatus
string sConnection


when target 0 "BYE" call pexit

set aspect control on
when quiet 1200 call closedown


sConnection="CSD"

dial TELNET sConnection
iStatus=$CARRIER
while (iStatus==1)
yield
iStatus=$CARRIER
endwhile
pause 1
switch iStatus
case 3
;Connection attempt failed, perform error handling
endcase
endswitch

endproc

proc closedown
disconnect
if waitfor "Login:"
main()
else
waitquiet 1200 forever
pwexit
endif
endproc

proc pexit
pause 1
usermsg "GOOD BYE !!!!"
pause 1
disconnect
pause 3
pwexit
endproc

proc closepc
integer iKey

keyget iKey
if iKey==27
usermsg "GOOD BYE !!!!"
pause 2
pwexit
endif
endproc

 
You can use this command to do so, just change "procedure" at the end to match the procedure name you want called when Escape is pressed:

when iskey 0 0x1B call procedure

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top