Intel® Fortran Compiler 18.0 Developer Guide and Reference

ACHAR

Elemental Intrinsic Function (Generic): Returns the character in a specified position of the ASCII character set, even if the processor's default character set is different. It is the inverse of the IACHAR function. In Intel® Fortran, ACHAR is equivalent to the CHAR function.

result = ACHAR (i [, kind])

i

(Input) Is of type integer.

kind

(Input; optional) Must be a scalar integer constant expression.

Results

The result type is character with length 1. If kind is present, the kind parameter of the result is that specified by kind; otherwise, the kind parameter of the result is that of default character. If the processor cannot represent the result value in the kind of the result, the result is undefined.

If i has a value within the range 0 to 127, the result is the character in position i of the ASCII character set; otherwise, it is processor defined. ACHAR (IACHAR(C)) has the value C for any character C capable of representation in the default character set. For a complete list of ASCII character codes, see Character and Key Code Charts.

Example

ACHAR (71) has the value 'G'.

ACHAR (63) has the value '?'.

See Also