MfuncErrorGet()函数

Synopsis

Get error code or message.

Format

long MfuncErrorGet(FunctionId, ErrorType, ErrorVarPtr)

MIL_ID FunctionId; Function identifier
long ErrorType; Error type
void *ErrorVarPtr; Pointer to a variable for the error

Description

This function allows you to read an error code or message that was previously reported. This function can be used to check the success of a MIL function call inside a pseudo-MIL function.

The FunctionId parameter is the MIL identifier of the pseudo-MIL function in use.

The ErrorType parameter identifies the type of error you want to read. It must be set to one of the following:

M_INTERNAL Error code returned by the last call to any MIL function. This code is reset to M_NULL_ERROR before each MIL function call and is set to a specific error code if an error occurs while executing the function. The error code is written in the location pointed to by ErrorVarPtr (when not M_NULL) as a long value and is also returned by MfuncErrorGet.
M_INTERNAL_SUB_NB Returns the number of error subcodes associated to the internal error. The number is written in the location pointed to by ErrorVarPtr (when not M_NULL) as a long value and is also returned by MfuncErrorGet.
M_INTERNAL_SUB_1,… M_INTERNAL_SUB_3 The nth error subcode associated to the current error. The error subcode is written in the location pointed to by ErrorVarPtr (when not M_NULL) as a long value and is also returned by MfuncErrorGet.
M_INTERNAL_FCT The function code associated to the current error. The function code is written in the location pointed to by ErrorVarPtr (when ErrorVarPtr is not M_NULL) as a long value and is also returned by MfuncErrorGet.
M_INTERNAL…+M_MESSAGE When M_MESSAGE is added to an M_INTERNAL… define, the function will return the string associated with specified error type. The string will be written in a character array pointed to by ErrorVarPtr. This array must be at least M_ERROR_MESSAGE_SIZE characters in size.

The ErrorVarPtr parameter is the address of the variable containing the error code or message.

To get the M_GLOBAL or M_CURRENT error, use the regular MappGetError function.

Returned value

The returned value is an error code or sub-error code; otherwise, M_NULL.