Error Message Definition and Use

MAKELRESULT(ERROR_NUM, ARG_NUM)

MAKELRESULT, as defined in MCADUSER.LIB, is used to assign appropriate return values to a function in the case of an error. The return value has two components: an error code, and which variable to highlight when displaying the error message in Mathcad.

Parameter

Description

ERROR_NUM

The number of the entry in the array of error message strings to return as the error message.

ARG_NUM

The index of the argument to highlight.

To create the error message table, make the following string array:

char * myErrorMessageTable[NUMBER_OF_ERRORS] =
{
   "interrupted",
   "insufficient memory",
   "must be real",
   etc...
};

So a call to MAKELRESULT(3,1) would display the third string, "must be real," under the first of the new function's arguments.

Note

The error message table must be registered with the CreateUserErrorMessageTable function for it to be used by MAKELRESULT.