Obtains from a parameter character values from either a menu of options or within a
numeric range KPG1_MIXVx
o one of a supplied list of acceptable values, with unambiguous abbreviations accepted; or
o a numeric character string equivalent to a number, and the number must lie within a supplied range of acceptable values.
There is a routine for each numerical data type: replace "
x"
in the routine name by D or R as
appropriate. The data range arguments supplied to the routine must have the data type
specified.
There are two stages to identify or validate each character value obtained from the parameter. In the first the value is converted to the required data type. If this is successful, the derived numeric value is compared with the range of acceptable values defined by VMIN and VMAX. A value satisfying these constraints is returned in the VALUES. The second stage searches for a match of the character value with an item in the menu.
This routine adheres to the following rules. o All comparisons are performed in uppercase. Leading
blanks are ignored. o A match is found when the value equals the full name of an option. This enables
an option to be the prefix of another item without it being regarded as ambiguous. For example, "
10,100,200"
would be an acceptable list of options. o If there is no exact match, an abbreviation is
acceptable. A comparison is made of the value with each option for the number of characters in the
value. The option that best fits the value is declared a match, subject to two provisos. Firstly, there
must be no more than one character different between the value and the start of the option. (This
allows for a mistyped character.) Secondly, there must be only one best-fitting option. Whenever these
criteria are not satisfied, the user is told of the error, and is presented with the list of options, before
being prompted for new values. This is not achieved through the MIN/MAX system.