home *** CD-ROM | disk | FTP | other *** search
- /*
- ** GetAString
- **
- ** $VER: GetAString 1.1.0 (5.11.93)
- **
- ** This ARexx script contains a function which asks the user to enter
- ** a string.
- **
- ** INPUTS
- ** Title -- text shown to the user asking for a string.
- ** DefaultStr -- default string.
- ** IsRequired -- TRUE, if the string is required; FALSE, otherwise.
- **
- ** RETURN
- ** EnteredStr -- the entered value, or "" if aborted.
- **
- ** This script should work with current versions of ARexx.
- **
- ** This script requires ADPro v2.5.0 (or higher).
- **
- ** 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'"' '"'DefaultStr'"' IsRequired
-
- Title = DQ || Title || DQ
- DefaultStr = DQ || DefaultStr || DQ
-
- continue = TRUE
- DO WHILE (continue = TRUE)
- ADPRO_TO_FRONT
-
- GETSTRING Title DefaultStr
- EnteredStr = ADPRO_RESULT
-
- IF (RC ~= 0) THEN DO
- IF (IsRequired = TRUE) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"GetAString"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN DO
- EnteredStr = DQ || DQ
- continue = FALSE
- END
- END
- ELSE DO
- EnteredStr = DQ || DQ
- continue = FALSE
- END
- END
- ELSE
- continue = FALSE
- END
-
- SCREEN_TO_FRONT "FRED"
-
- RETURN EnteredStr
-
- EXIT 0
-