home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST114.PRG < prev    next >
Encoding:
Text File  |  1989-08-11  |  2.5 KB  |  84 lines

  1. ********************
  2.  
  3. FUNCTION Whichway
  4.  
  5.    PARAMETERS _wrow, _wcol, _wframe, _wfile
  6.    
  7.    * _wrow is the row coordinate for the window
  8.    * _wcol is the column coordinate for the window
  9.    * _wframe is which window style to use 
  10.    * wayvalue is the value passed back to the function
  11.    * _wfile is the name of the file changed.  Needs to be passed by reference
  12.  
  13.    IF PCOUNT() != 4
  14.       RETURN(-1)
  15.    ENDIF
  16.  
  17.    IF TYPE("_wrow") + TYPE("_wcol") + TYPE("_wframe") + TYPE("_wfile") != "NNLC"
  18.       RETURN(-1)
  19.    ENDIF
  20.  
  21.    PRIVATE _wayval, _revl, _tempw, _offset
  22.    
  23.    _wayval = 1
  24.  
  25.    * DO Totalkeyon  && Modify this section depending on the menu type selected
  26.    *                   Totalkey on activates the down arrow as a CHR(13).  If
  27.    *                   the menu type is top->bottom, Totalkeyon should be left OFF
  28.    *                   However, if it is left->right (ELSE), then you may want to
  29.    *                   have Totalkeyon ON and Totalkeyoff activated at the end.
  30.  
  31.    IF _wframe
  32.       Wpush(_wrow, _wcol, _wrow + 5, _wcol + 22)
  33.       @ Wrow(1),Wcol(1) PROMPT " 1> Print to Screen  "
  34.       @ Wrow(2),Wcol(1) PROMPT " 2> Print to Printer "
  35.       @ Wrow(3),Wcol(1) PROMPT " 3> Print to File    "
  36.       @ Wrow(4),Wcol(1) SAY    "    ESC to RETURN"
  37.    ELSE
  38.       Wpush(_wrow, _wcol, _wrow+ 4, _wcol+ 35)
  39.       @ Wrow(1), Wcol(12)  SAY "   Print to"
  40.       @ Wrow(2), Wcol(5)  PROMPT " Screen "
  41.       @ Wrow(2), Wcol(15) PROMPT " Printer "
  42.       @ Wrow(2), Wcol(27) PROMPT " File "
  43.       @ Wrow(3), Wcol(12) SAY "ESC to RETURN"
  44.    ENDIF
  45.    MENU TO _wayval
  46.  
  47.    _revl = _wcol
  48.    IF _wayval = 3
  49.  
  50.       _tempw = _wfile       && Temporary way file
  51.       
  52.       IF LEN(_tempw) < 15
  53.          _wfile = Fill_out(_tempw, 15)
  54.       ENDIF
  55.     
  56.       Clear_area()
  57.       IF _wframe
  58.          @ Wrow(1), Wcol(2) SAY "Enter File Name: "
  59.          @ Wrow(3), Wcol(2) SAY "->" GET _wfile PICT "@X"
  60.       ELSE
  61.          @ Wrow(2), Wcol(1) SAY "Enter File Name:" GET _wfile PICT "@X"
  62.       ENDIF
  63.       Sjsread()
  64.       IF EMPTY(_wfile)
  65.          _wayval = 0
  66.       ELSE
  67.          IF AT(".", _wfile) = 0
  68.             IF AT(":", _wfile) = 0
  69.                _wfile = Upperlower(TRIM(SUBSTR(_wfile,1,8))) + ".txt"
  70.             ELSE
  71.                _wfile = SUBSTR(_wfile,1,2) + UPPER(TRIM(SUBSTR(_wfile,3,8))) + ".txt"
  72.             ENDIF
  73.          ELSE
  74.             _wfile = Upperlower(TRIM(_wfile))
  75.          ENDIF
  76.          _wfile = Upperlower(_wfile)
  77.       ENDIF
  78.    ENDIF
  79.    Wpop()
  80.    RETURN(_wayval)
  81.       
  82. * End of File
  83.  
  84.