ACHAR (The GNU Fortran Compiler) (original) (raw)
8.5 ACHAR
— Character in ASCII collating sequence ¶
Synopsis:
RESULT = ACHAR(I [, KIND])
Description:
ACHAR(I)
returns the character located at position I
in the ASCII collating sequence.
Class:
Elemental function
Arguments:
I | The type shall be INTEGER. |
---|---|
KIND | (Optional) A scalar INTEGER constant expression indicating the kind parameter of the result. |
Return value:
The return value is of type CHARACTER
with a length of one. If the KIND argument is present, the return value is of the specified kind and of the default kind otherwise.
Example:
program test_achar character c c = achar(32) end program test_achar
Notes:
See ICHAR — Character-to-integer conversion function for a discussion of converting between numerical values and formatted string representations.
Standard:
Fortran 77 and later, with KIND argument Fortran 2003 and later
See also:
CHAR — Character conversion function,
IACHAR — Code in ASCII collating sequence,
ICHAR — Character-to-integer conversion function