home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / procomm / pcpdial.arc / DISC-C.CMD next >
OS/2 REXX Batch file  |  1988-01-18  |  2KB  |  41 lines

  1. ;DISC.CMD  Used for disconnecting from BBSs
  2.  
  3. SET PARITY EVEN          ;Set parity and databits
  4. SET DATABITS 7           ; for communicating with Telenet
  5. LABEL1:                  ;Loop to here in case of failed attempt
  6. PAUSE 1                  ;Start "escape to command mode" sequence: wait one second
  7. TRANSMIT "+++"           ;Send "+++" to escape to command mode
  8. WAITFOR "OK" 3           ;Wait a maximum of three seconds for "OK" prompt
  9. IF NOT WAITFOR           ;If no "OK" prompt,
  10.   GOTO LABEL1            ;Try again
  11. ENDIF
  12. TRANSMIT "ATZ!"          ;Otherwise, reset remote modem
  13. WAITFOR "OK"             ;Wait for "OK" prompt
  14. TRANSMIT "ATH0!"         ;Send disconnect command
  15. WAITFOR "OK"             ;Wait for "OK" prompt
  16. PAUSE 1                  ;Allow user to see results
  17. CLEAR                    ;Clear screen
  18. LOCATE 11,14             ;Locate for message
  19. MESSAGE "BBS has been disconnected.  Start VERSA now <Y/N>?"
  20. LABEL2:                  ;Loop to here in case of erroneous input
  21. LOCATE 11,65             ;Locate for user input
  22. GET S6 1                 ;Get user input (1 character)
  23. SWITCH S6                ;Decision based on S6 (user input)
  24.   CASE "Y"               ;If the user enters "Y",
  25.     EXECUTE "VERSA.CMD"  ; then start VERSA.CMD
  26.   ENDCASE
  27.   CASE "N"               ;If the user enters "N",
  28.     CLEAR                ; clear screen,
  29.     EXIT                 ; and exit
  30.   ENDCASE
  31.   CASE "E"               ;If the user enters "E",
  32.     CLEAR                ; clear screen,
  33.     EXIT                 ; and exit
  34.   ENDCASE
  35.   DEFAULT                ;Erroneous input
  36.     LOCATE 11,65         ;Locate cursor,
  37.     MESSAGE "^G "        ; beep, erase erroneous input,
  38.     GOTO LABEL2          ; and redo the GET
  39.   ENDCASE
  40. ENDSWITCH                ;End of decision based on user input
  41.