runner_prefix Subroutine

public subroutine runner_prefix(pattern, prefix, result)

This subroutine runs the is_valid_prefix function and prints the result.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: pattern
character(len=*), intent(in) :: prefix
logical, intent(inout) :: result

Source Code

   subroutine runner_prefix(pattern, prefix, result)
      implicit none
      character(*), intent(in) :: pattern, prefix
      logical, intent(inout) :: result
      logical :: res
      character(:), allocatable :: resulting

      res = is_valid__prefix(pattern, prefix, resulting)

      if (res) then
#ifndef FAILED
         write(output_unit, '(a,a,a)') 'result(prefix): Success', ' '//trim(pattern), ' "'//trim(prefix)//'"'
#endif
      else
         write(error_unit, '(a,a,a,a)') 'result(prefix): FAILED ', ' '//trim(pattern), &
               ' "'//trim(prefix)//'", but ... ', trim(resulting)
      end if
      result = result .and. res
   end subroutine runner_prefix