home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Whichway
-
- PARAMETERS _wrow, _wcol, _wframe, _wfile
-
- * _wrow is the row coordinate for the window
- * _wcol is the column coordinate for the window
- * _wframe is which window style to use
- * wayvalue is the value passed back to the function
- * _wfile is the name of the file changed. Needs to be passed by reference
-
- IF PCOUNT() != 4
- RETURN(-1)
- ENDIF
-
- IF TYPE("_wrow") + TYPE("_wcol") + TYPE("_wframe") + TYPE("_wfile") != "NNLC"
- RETURN(-1)
- ENDIF
-
- PRIVATE _wayval, _revl, _tempw, _offset
-
- _wayval = 1
-
- * DO Totalkeyon && Modify this section depending on the menu type selected
- * Totalkey on activates the down arrow as a CHR(13). If
- * the menu type is top->bottom, Totalkeyon should be left OFF
- * However, if it is left->right (ELSE), then you may want to
- * have Totalkeyon ON and Totalkeyoff activated at the end.
-
- IF _wframe
- Wpush(_wrow, _wcol, _wrow + 5, _wcol + 22)
- @ Wrow(1),Wcol(1) PROMPT " 1> Print to Screen "
- @ Wrow(2),Wcol(1) PROMPT " 2> Print to Printer "
- @ Wrow(3),Wcol(1) PROMPT " 3> Print to File "
- @ Wrow(4),Wcol(1) SAY " ESC to RETURN"
- ELSE
- Wpush(_wrow, _wcol, _wrow+ 4, _wcol+ 35)
- @ Wrow(1), Wcol(12) SAY " Print to"
- @ Wrow(2), Wcol(5) PROMPT " Screen "
- @ Wrow(2), Wcol(15) PROMPT " Printer "
- @ Wrow(2), Wcol(27) PROMPT " File "
- @ Wrow(3), Wcol(12) SAY "ESC to RETURN"
- ENDIF
- MENU TO _wayval
-
- _revl = _wcol
- IF _wayval = 3
-
- _tempw = _wfile && Temporary way file
-
- IF LEN(_tempw) < 15
- _wfile = Fill_out(_tempw, 15)
- ENDIF
-
- Clear_area()
- IF _wframe
- @ Wrow(1), Wcol(2) SAY "Enter File Name: "
- @ Wrow(3), Wcol(2) SAY "->" GET _wfile PICT "@X"
- ELSE
- @ Wrow(2), Wcol(1) SAY "Enter File Name:" GET _wfile PICT "@X"
- ENDIF
- Sjsread()
- IF EMPTY(_wfile)
- _wayval = 0
- ELSE
- IF AT(".", _wfile) = 0
- IF AT(":", _wfile) = 0
- _wfile = Upperlower(TRIM(SUBSTR(_wfile,1,8))) + ".txt"
- ELSE
- _wfile = SUBSTR(_wfile,1,2) + UPPER(TRIM(SUBSTR(_wfile,3,8))) + ".txt"
- ENDIF
- ELSE
- _wfile = Upperlower(TRIM(_wfile))
- ENDIF
- _wfile = Upperlower(_wfile)
- ENDIF
- ENDIF
- Wpop()
- RETURN(_wayval)
-
- * End of File
-