home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / TE2HOST.ZIP / GOODBYE.SCR < prev    next >
Text File  |  1990-12-27  |  1KB  |  57 lines

  1. ;; --------------------------------------------------------------------------
  2. ;;
  3. ;; GoodBye.scr -- Host mode script suite for TE/2
  4. ;;                Copyright 1990, Oberon Software, All rights reserved
  5. ;;
  6. ;; --------------------------------------------------------------------------
  7.  
  8. global string WarnOn
  9. global string WarnOff
  10. global string CmdStack
  11.  
  12. integer KeyIn
  13.  
  14.   ;; ------------------------------------------------------------------------
  15.   ;; Ask for confirmation at exit and hangup if we get it.
  16.  
  17.  
  18. subroutine CheckOK
  19.  
  20.   if ((KeyIn == asciival("Y")) or (KeyIn == asciival("y")))
  21.     if connected
  22.       transmit("^M^JY'all come back now, here?^M^J^J")
  23.     endif
  24.     hangup(false)
  25.   endif
  26.   CmdStack = ""
  27.  
  28. endsub
  29.  
  30.  
  31. subroutine GoodBye
  32.  
  33.   if connected
  34.  
  35.     if strlen(CmdStack)
  36.       KeyIn = asciival(CmdStack)
  37.     else
  38.       transmit("^M^J^J%sDo you really want to exit [y/N]?%s ", WarnOn, WarnOff)
  39.       KeyIn = rgetc(30, 1)
  40.       if timedout
  41.         KeyIn = asciival("Y")
  42.       endif
  43.     endif
  44.     gosub CheckOK
  45.  
  46.   endif
  47.  
  48. endsub
  49.  
  50.  
  51. program
  52.   gosub GoodBye
  53.   end
  54.  
  55.  
  56.  
  57.