FNLStat : Utilities : ACHAR
ACHAR
This function returns a character given its ASCII value.
Function Return Value
ACHAR β€” CHARACTER * 1 string containing the character in the I‑th position of the ASCII collating sequence. (Output)
Required Arguments
I β€” Integer ASCII value of the character desired. (Input)
I must be greater than or equal to zero and less than or equal to 127.
FORTRAN 90 Interface
Generic: ACHAR (I)
Specific: The specific interface name is ACHAR.
FORTRAN 77 Interface
Single: ACHAR (I)
Description
Routine ACHAR returns the character of the input ASCII value. The input value should be between 0 and 127. If the input value is out of range, the value returned in ACHAR is machine dependent.
Example
This example returns the character of the ASCII value 65.
 
USE ACHAR_INT
USE UMACH_INT
 
IMPLICIT NONE
INTEGER I, NOUT
!
CALL UMACH (2, NOUT)
! Get character for ASCII value
! of 65 ('A')
I = 65
WRITE (NOUT,99999) I, ACHAR(I)
!
99999 FORMAT (' For the ASCII value of ', I2, ', the character is : ', &
A1)
END
Output
 
For the ASCII value of 65, the character is : A
Published date: 03/19/2020
Last modified date: 03/19/2020