CHAR(3I) Last changed: 1-6-98
NAME
CHAR, ICHAR - Converts integer to character and vice versa
SYNOPSIS
CHAR([I=]i, [KIND=]kind)
ICHAR([C=]c)
IMPLEMENTATION
UNICOS, UNICOS/mk, and IRIX systems
STANDARDS
Fortran 90
DESCRIPTION
CHAR and ICHAR are inverse functions.
CHAR converts an integer or Boolean argument to a character specified
by the ASCII collating sequence. ICHAR converts a character argument
to an integer based on the character position in the collating
sequence.
These intrinsic functions accept the following arguments:
i Must be of type integer or Boolean. If of type integer, i must
be in the range 0 <= i <= 255.
kind Must be a scalar integer initialization expression.
c Must be of type character and of length one.
The type conversion routines assign the appropriate type to Boolean
arguments without shifting or manipulating the bit patterns they
represent. For example, CHAR(i) returns the ith character in the
collating sequence.
CHAR and ICHAR are elemental functions. The names of these intrinsics
cannot be passed as arguments.
RETURN VALUES
For CHAR, the result is a character of length one. If the kind
parameter is present, the kind type parameter is that specified by
kind. Otherwise the kind type parameter is that of the default
character type. The result is the character in position i of the
ASCII collating sequence associated with the specified kind type
parameter.
For ICHAR, the result is the position c in the collating sequence
associated with the kind type parameter of c and is in the range
0 <= ICHAR(c) <= 255. For any characters C and D capable of being
represented, C .LE. D is true if and only if ICHAR (C) .LE. ICHAR(D)
is true and C .EQ. D is true if and only if ICHAR(C) .EQ. ICHAR(D) is
true.
SEE ALSO
Intrinsic Procedures Reference Manual, publication SR-2138, for the
printed version of this man page.