Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

228 Chapter9
Intrinsics Reference (cont)
FERRMSG
FERRMSG
Returns a message corresponding to an FCHECK error number.
Syntax
I16 CA I16
FERRMSG(fserrorcode,msgbuffer,msglength);
Use
You can use FERRMSG in your program to obtain the error message
associated with a specific error number returned in a call to FCHECK.
The FCHECK error number is used as the value of fserrorcode in the
call to FERRMSG. The textual message associated with the error
number is then returned in msgbuffer, with the length of the message
returned in msglength.
A typical error handling routine might consist of the following steps:
1. Check condition code.
2. If CCL or CCG, call FCHECK to obtain specific details about the
error that occurred, including the error number.
3. Call FERRMSG using the error number obtained in the FCHECK
call as the value of fserrorcode.
You can then print the error message, display it to the terminal screen
or console, or take whatever action is appropriate.
Parameters
fserrorcode 16-bit signed integer by reference
(required)
Passes an error code returned by the FCHECK intrinsic
indicating which message is to be returned in
msgbuffer.
msgbuffer character array (required)
Returns the error message associated with
fserrorcode. To contain the longest possible message,
msgbuffer must be a minimum of 72 bytes long. Note
that all character arrays must start on a halfword
boundary.
msglength 16-bit signed integer by reference
(required)