home *** CD-ROM | disk | FTP | other *** search
- /*
- ** GetAFile
- **
- ** $VER: GetAFile 1.1.0 (5.11.93)
- **
- ** This ARexx script contains a function which asks the user to enter
- ** a filename.
- **
- ** INPUTS
- ** Title -- text shown to the user asking for a string.
- ** DefaultDir -- default directory.
- ** DefaultFile -- default filename.
- ** IsRequired -- TRUE, if the filename is required; FALSE, otherwise.
- **
- ** RETURN
- ** EnteredFile -- the entered filename, or "" if aborted.
- **
- ** This script should work with current versions of ARexx.
- **
- ** Copyright © 1992-1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
- PARSE ARG Arguments
- PARSE VAR Arguments '"'Title'"' '"'DefaultDir'"' '"'DefaultFile'"' IsRequired
-
- Title = DQ || Title || DQ
- DefaultDir = DQ || DefaultDir || DQ
- DefaultFile = DQ || DefaultFile || DQ
-
- continue = TRUE
- DO WHILE (continue = TRUE)
- ADPRO_TO_FRONT
-
- GETFILE Title DefaultDir DefaultFile
- EnteredFile = ADPRO_RESULT
-
- IF (RC ~= 0) THEN DO
- IF (IsRequired = TRUE) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"GetAFile"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN DO
- EnteredFile = DQ || DQ
- continue = FALSE
- END
- END
- ELSE DO
- EnteredFile = DQ || DQ
- continue = FALSE
- END
- END
- ELSE
- continue = FALSE
- END
-
- SCREEN_TO_FRONT "FRED"
-
- RETURN EnteredFile
-
- EXIT 0
-