char(3I)

CHAR, ACHAR, ICHAR, IACHAR - Performs conversion and positioning functions

As shipped in IRIX 6.5.19. Last changed in IRIX 6.5.19.

NAME
     CHAR, ACHAR, ICHAR, IACHAR - Performs conversion and positioning
     functions

SYNOPSIS
     CHAR([I=]i, [KIND=]kind)

     ACHAR([I=]i)

     ICHAR([C=]c)

     IACHAR ([C=]c)

STANDARDS
     Fortran

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.  CHAR and ICHAR
     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.

     ACHAR returns the character in a specified position of the ASCII
     collating sequence.  This intrinsic is not accepted by the MIPSpro
     Fortran 77 compiler.

     IACHAR returns the position of a character in the ASCII collating
     sequence.  This intrinsic is not accepted by the MIPSpro Fortran 77
     compiler.

     These intrinsic functions accept the following arguments:

     i         For CHAR and ICHAR, must be of type integer or Boolean.  If
               of type integer, i must be in the range 0 <= i <= 255.

               For ACHAR, must be of type integer.

     kind      An integer scalar value.  Must be a scalar integer
               initialization expression.  This argument is not accepted by
               the MIPSpro Fortran 77 compiler.

     c         Must be of type character and of length 1.

     These are elemental functions.  The names of these intrinsics cannot
     be passed as arguments.

RETURN VALUES
     CHAR returns 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.

     ACHAR returns a character of length 1.  If i has a value in the range
     0 <= i <= 127, the result is the character in position i of the ASCII
     collating sequence.  ACHAR (IACHAR (c)) has the value c for any
     character c capable of representation.

     ICHAR returns a default integer value.  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.

     IACHAR returns a default integer value.  If c is in the collating
     sequence defined by the codes specified in ISO 646:1983 (International
     Reference Version), the result is the position of c in that sequence
     and satisfies the inequality 0 <= IACHAR (c) <= 127.  The results are
     consistent with the LGE, LGT, LLE, and LLT lexical comparison
     functions.  For example, if LLE(C,D) is true, IACHAR(C).LE.IACHAR(D)
     is true when C and D are any two ASCII characters.

EXAMPLES
     IACHAR('X') yields the value 88.

     ACHAR(88) yields 'X'.