/* ** GetAFloat ** ** $VER: GetAFloat 1.1.0 (5.11.93) ** ** This ARexx script contains a function which asks the user to enter ** a floating point number. ** ** INPUTS ** Title -- text shown to the user asking for a value. ** DefaultVal -- default value. ** MinVal -- minimum value allowed. ** MaxVal -- maximum value allowed. ** IsRequired -- TRUE, if the value is required; FALSE, otherwise. ** ** RETURN ** EnteredVal -- the entered value, or "CANCEL" if aborted. ** ** This script should work with current versions of ARexx. ** ** Copyright © 1992-1993 Elastic Reality, Inc. ** 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'"' DefaultVal MinVal MaxVal IsRequired Title = DQ || Title || DQ continue = TRUE DO WHILE (continue = TRUE) ADPRO_TO_FRONT GETFLOAT Title DefaultVal MinVal MaxVal EnteredVal = ADPRO_RESULT IF (RC ~= 0) THEN DO IF (IsRequired = TRUE) THEN DO ADPRO_TO_FRONT OKAYN '"GetAFloat"' '"This value is required."' '"Retry|Cancel"' IF (RC = 0) THEN DO EnteredVal = "CANCEL" continue = FALSE END END ELSE DO EnteredVal = "CANCEL" continue = FALSE END END ELSE continue = FALSE END SCREEN_TO_FRONT "FRED" RETURN EnteredVal EXIT 0