Description:
This routine obtains a vector of character values from
a parameter. Each value must be one of a supplied list of acceptable values, and can be
an abbreviation provided it is unambiguous.
Invocation
CALL PAR_CHOIV( PARAM,
MAXVAL, OPTS, VALUES, ACTVAL, STATUS )
Arguments
PARAM = CHARACTER
(
) (Given)
The name of the parameter.
MAXVAL = INTEGER (Given)
The maximum number of values required.
A PAR__ERROR status is returned when the number of values requested is less than one.
OPTS =
CHARACTER
( )
(Given)
The list of acceptable options for the values obtained from the parameter. Items should be
separated by commas. The list is case-insensitive.
VALUES( MAXVAL ) = CHARACTER
(
) (Returned)
The selected options from the list in the order supplied to the parameter.
They are in uppercase and in full, even if an abbreviation has been given for the actual
parameter.
ACTVAL = INTEGER (Returned)
The actual number of values obtained.
STATUS = INTEGER (Given and Returned)
The global status.
Notes:
The search for a
match of each obtained character value with an item in the menu adheres to the following
rules.
- All comparisons are performed in uppercase. Leading blanks are ignored.
- 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.
- 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 a new value If a nearest match is selected, the user
is informed unless the MSG filtering level (see SUN/104) is ‘quiet’.