Fortran Wiki
selected_char_kind

Description

selected_char_kind(name) returns the kind value for the character set named name, if a character set with such a name is supported, or 1 otherwise. Currently, supported character sets include “ASCII” and “DEFAULT”, which are equivalent.

Standard

Fortran 2003 and later

Class

Transformational function

Syntax

result = selected_char_kind(name)

Arguments

  • name - Shall be a scalar and of the default character type.

Example

program ascii_kind
  integer,parameter :: ascii = selected_char_kind("ascii")
  character(kind=ascii, len=26) :: s

  s = ascii_"abcdefghijklmnopqrstuvwxyz"
  print *, s
end program ascii_kind

category: intrinsics