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

  1. ;; --------------------------------------------------------------------------
  2. ;;
  3. ;; GetFSpec.scr -- Host mode script suite for TE/2
  4. ;;                 Copyright 1990, Oberon Software, All rights reserved
  5. ;;
  6. ;; --------------------------------------------------------------------------
  7.  
  8. global string  FileSpec
  9. global string  DfltSpec
  10. global string  CmdStack
  11.  
  12.   ;; ------------------------------------------------------------------------
  13.   ;; Standard routine for input of file.  If there is anything in the string
  14.   ;;  variable "DfltSpec", the prompt is altered and an empty response is
  15.   ;;  set to that string.
  16.  
  17. subroutine GetFileSpec
  18.  
  19.   if strlen(CmdStack) == 0
  20.     FileSpec = ""
  21.     if strlen(DfltSpec)
  22.       transmit("^M^JEnter file specification [Enter=%s]: ", DfltSpec)
  23.     else
  24.       transmit("^M^JEnter file specification: ")
  25.     endif
  26.     FileSpec = rgets(64, 30, 1)
  27.     FileSpec = strtrim(FileSpec)
  28.     if ((strlen(FileSpec) == 0) and (strlen(DfltSpec) > 0))
  29.       FileSpec = DfltSpec
  30.     endif
  31.   else
  32.     FileSpec = CmdStack
  33.     CmdStack = ""
  34.   endif
  35.  
  36. endsub
  37.  
  38.  
  39. program
  40.   gosub GetFileSpec
  41.   end
  42.  
  43.