List Operations [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Reference Manual
List Operations
List operations select from a list of values.
A calculated item, for example, which translates the weekday number into
a three-character string, could be specified using nested IF THEN ELSE
constructions, like this:
IF weekday = 1 THEN "MON"
ELSE IF weekday = 2 THEN "TUE"
ELSE IF weekday = 3 THEN "WED"
ELSE IF weekday = 4 THEN "THU"
ELSE IF weekday = 5 THEN "FRI"
ELSE IF weekday = 6 THEN "SAT"
ELSE "SUN"
However, a more efficient method is to select from a list of values, as
shown here:
weekday OF
("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN")
where weekday is the index, "MON" is 1..., and "SUN" is 7. Each item in
the list must be of the same type and separated by commas.
NOTE If the index points outside of the list, the resulting value of the
list selection will be an index violation (see "Exception Values"
in this chapter).
Related Sections
* IF THEN ELSE
[REV BEG]
MPE/iX 5.0 Documentation