Fortran Wiki achar

Description

achar(i) returns the character located at position i in the ASCII collating sequence.

Standard

FORTRAN 77 and later, with kind argument Fortran 2003 and later

Class

Elemental function

Syntax

result = achar(i [, kind])

Arguments

• i - the type shall be integer.
• kind - (optional) an integer initialization 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

Note

see ichar for a discussion of converting between numerical values and formatted string representations.

See also

category: intrinsics