[UP]


Manual Reference Pages  - achar (3)

NAME

achar(3f) - [FORTRAN:INTRINSIC:CHARACTER] returns a character in a specified position in the ASCII collating sequence

SYNTAX

result = ACHAR(I [, KIND])

DESCRIPTION

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

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

Sample program:

    program demo_achar
    implicit none
    character(len=1) :: c
    integer,parameter :: blank=32
    integer :: i
      c = achar(blank)
      write(*,’(i0,1x,a,1x,b0,1x,o0,1x,z0)’)blank,c,c,c,c
      write(*,’(32(a))’) (achar(i),i=32,126)
    end program demo_achar

Results:

   32   100000 40 20
    !"#$%&’()*+,-./0123456789:;<=>?
   @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
   ‘abcdefghijklmnopqrstuvwxyz{|}~

NOTE

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

STANDARD

[[FORTRAN 77]] and later, with KIND argument Fortran 2003 and later

CLASS

Elemental function

SEE ALSO

char(3), iachar(3), ichar(3)

Functions that perform operations on character strings, return lengths of arguments, and search for certain arguments:
elemental:
  adjustl(3), adjustr(3), index(3), len_trim(3), scan(3), verify(3)
nonelemental:
  repeat(3), trim(3)


achar (3) March 11, 2021
Generated by manServer 1.08 from bf7680dd-2bc5-4eb9-b19b-f65f4264be89 using man macros.