is_graphical Function

public elemental function is_graphical(c)

Checks whether or not c is a printable character other than the space character.

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: c

The character to test.

Return Value logical


Variables

Type Visibility Attributes Name Initial
integer, private :: ic

Source Code

   elemental logical function is_graphical(c)
      character(len=1), intent(in) :: c
          !! The character to test.
      integer :: ic
      ic = iachar(c)
      !The character is graphical if it's between '!' and '~' in the ASCII table,
      !that is: printable but not a space
      is_graphical = (int(z'21') <= ic) .and. (ic <= int(z'7E'))
   end function is_graphical