Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public
Document Table of Contents

IACHAR

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

result = IACHAR (c [, kind])

c

(Input) Must be of type character of length 1.

kind

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

Results

The result type is integer. 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 integer. If c is in the ASCII collating sequence, the result is the position of c in that sequence and satisfies the inequality (0 .le. IACHAR(c) .le. 127).

The results must be 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 also true.

Example

IACHAR ( 'Y' ) has the value 89.

IACHAR ( '%' ) has the value 37.