Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | code |
pure function get_error_message(code) result(msg) implicit none integer, intent(in) :: code character(:), allocatable :: msg select case (code) case (SYNTAX_ERR) msg = err_generic case (SYNTAX_ERR_PARENTHESIS_MISSING) msg = err_r_parenthesis_missing case (SYNTAX_ERR_PARENTHESIS_UNEXPECTED) msg = err_r_parenthesis_unexpected case (SYNTAX_ERR_BRACKET_MISSING) msg = err_r_bracket_missing case (SYNTAX_ERR_BRACKET_UNEXPECTED) msg = err_r_bracket_unexpected case (SYNTAX_ERR_CURLYBRACE_MISSING) msg = err_r_curlybrace_missing case (SYNTAX_ERR_CURLYBRACE_UNEXPECTED) msg = err_r_curlybrace_unexpected case (SYNTAX_ERR_INVALID_RANGE) msg = err_invalid_range case default msg = err_is_nothing end select end function get_error_message