This function checks if a pattern is found within a string and
compares the result to the correct_answer
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
logical, | intent(in) | :: | correct_answer |
function is_valid__in(pattern, str, correct_answer) result(res) implicit none character(*), intent(in) :: pattern, str logical, intent(in) :: correct_answer logical :: res res = (pattern .in. str) .eqv. correct_answer end function is_valid__in