HP 3000 Manuals

CHAR Function [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

CHAR Function 

The CHAR function returns a one-character alphanumeric value that is a
character in the program collating sequence having the ordinal position
equal to the value of parameter-1.  The function type is alphanumeric.

Syntax 

     FUNCTION CHAR (parameter-1)

Parameters 

parameter-1           Must be an integer.  Must be greater than zero and
                      less than or equal to the number of positions in
                      the collating sequence.

Return Value 

If more than one character has the same position in the program collating
sequence, the character returned as the function value is that of the
first literal specified for that character position in the ALPHABET
clause.

If the current program collating sequence was not specified by an
ALPHABET clause, the ASCII collating sequence is used.  See Appendix D
, "ASCII and EBCDIC Character Sets," for a listing of the ASCII
character set.

Example 

     DISPLAY FUNCTION CHAR(50).
     DISPLAY FUNCTION CHAR(64).
     DISPLAY FUNCTION CHAR(88).

The above example displays the following:

     1
     ?
     W



MPE/iX 5.0 Documentation