runner_in Subroutine

public subroutine runner_in(pattern, str, answer, result)

This subroutine runs the is_valid__in function and prints the result.

Arguments

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

Source Code

   subroutine runner_in(pattern, str, answer, result)
      implicit none
      character(*), intent(in)    :: pattern, str
      logical,      intent(in)    :: answer
      logical,      intent(inout) :: result
      logical :: res

      res = is_valid__in(pattern, str, answer)

      if (res) then
         write(error_unit, '(a, a, a)') 'result(in   ): Success', ' '//trim(pattern)
      else
         write(error_unit, '(a, a, a)') 'result(in   ): FAILED ', ' '//trim(pattern), ' '//trim(str)
      end if

      result = result .and. res
   end subroutine runner_in