isgraph Function

public elemental function isgraph(onechar)

NAME

 isgraph(3f) - [M_strings:COMPARE] returns .true. if character is a
 printable character except a space is considered non-printable
 (LICENSE:PD)

SYNOPSIS

elemental function isgraph(onechar)

 character,intent(in) :: onechar
 logical              :: isgraph

DESCRIPTION

isgraph(3f) returns .true. if character is a printable character
except a space is considered non-printable

OPTIONS

onechar   character to test

RETURNS

isgraph   logical value returns true if character is a printable
          non-space character

EXAMPLE

Sample Program:

program demo_isgraph
use M_strings, only : isgraph
implicit none
integer                    :: i
character(len=1),parameter :: string(*)=[(char(i),i=0,127)]
   write(*,'(40(a))')'ISGRAPH: ',pack( string, isgraph(string) )
end program demo_isgraph

Results:

ISGRAPH: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG
HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno
pqrstuvwxyz{|}~

AUTHOR

 John S. Urban

LICENSE

 Public Domain

Arguments

Type IntentOptional Attributes Name
character, intent(in) :: onechar

Return Value logical


Contents

Source Code


Source Code

elemental function isgraph(onechar)

! ident_66="@(#) M_strings isgraph(3f) indicates if character is printable ASCII character excluding space"

character,intent(in) :: onechar
logical              :: isgraph
   select case (iachar(onechar))
   case (33:126)
     isgraph=.TRUE.
   case default
     isgraph=.FALSE.
   end select
end function isgraph