Checks whether or not c is a printable character other than the
space character.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | c |
The character to test. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | ic |
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