Is there a way to retrieve the error message text for an RTL error that doesn't include a Win32 error? For example if one does an internal read, such as
read (string, '(i)', iostat=status) number
and there is an error, about all you can say is
if (status .ne. 0) type *, 'RTL error ', iostat
You can use ERRSNS in many cases where an underlying Win32 I/O routine was used but not in all cases. If the second parameter is zero then you essentially have no error message to retrieve, as in the case above.
What I am looking for is something like under the OVMS compiler where you have message numbers defined in $FORDEF that correspond to the iostat values, such that you can do an ERRSNS(,,,,status) and lookup the message according to that return value, which is one of the FOR$_xxx constants defined for $FORDEF. This way we could go ahead and use ForrmatMessage and return an appropriate error message in a controlled fashion.
I ask because I was once quoted telling someone that we are past the days where we have to look up numeric error codes to determine what went wrong at runtime. :-)