Manual Reference Pages  - iscntrl (3m_strings)

NAME

iscntrl(3f) - [M_strings:COMPARE] returns .true. if character is a delete character or ordinary control character (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

elemental function iscntrl(onechar)

    character(len=*),intent(in) :: onechar
    logical              :: iscntrl

DESCRIPTION

iscntrl(3f) returns .true. if character is a delete character or ordinary control character

OPTIONS

onechar
  character to test

RETURNS

iscntrl
  returns true logical value if character is a control
character.
  If a multi-byte string was input .false. is returned if any character is not a control character. A null string returns .false.

EXAMPLES

Sample program

   program demo_iscntrl
   use M_strings, only : iscntrl
   implicit none
   integer                    :: i
   character(len=1),parameter :: string(*)=[(char(i),i=0,127)]
      write(*,’(20(g0,1x))’)’ISCNTRL: ’, &
      & iachar(pack( string, iscntrl(string) ))
   end program demo_iscntrl

Results:

   ISCNTRL:  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
   20 21 22 23 24 25 26 27 28 29 30 31 127

AUTHOR

John S. Urban

LICENSE

Public Domain