Manual Reference Pages  - matching_delimiter (3m_strings)

NAME

matching_delimiter(3f) - [M_strings:QUOTES] find position of matching delimiter (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

impure elemental subroutine matching_delimiter(str,ipos,imatch)

   character(len=*),intent(in)  :: str
   integer,intent(in)           :: ipos
   integer,intent(out)          :: imatch

DESCRIPTION

Sets imatch to the position in string of the delimiter matching the delimiter in position ipos. Allowable delimiters are (), [], {}, <>.

OPTIONS

str input string to locate delimiter position in
ipos position of delimiter to find match for
imatch location of matching delimiter. If no match is found, zero (0) is returned.

EXAMPLES

Sample program:

   program demo_matching_delimiter
      use M_strings, only : matching_delimiter
      implicit none
      character(len=128)  :: str
      integer             :: imatch

str=’ a [[[[b] and ] then ] finally ]’ write(*,*)’string=’,str call matching_delimiter(str,1,imatch) write(*,*)’location=’,imatch call matching_delimiter(str,4,imatch) write(*,*)’location=’,imatch call matching_delimiter(str,5,imatch) write(*,*)’location=’,imatch call matching_delimiter(str,6,imatch) write(*,*)’location=’,imatch call matching_delimiter(str,7,imatch) write(*,*)’location=’,imatch call matching_delimiter(str,32,imatch) write(*,*)’location=’,imatch

end program demo_matching_delimiter

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 matching_delimiter (3m_strings) July 20, 2024
Generated by manServer 1.08 from 7a51c6ed-1458-48b8-95c5-91a3f93efe23 using man macros.