JavaScript Editor js editor     Web development 

Main Page

Reports an error with the null-terminated text you specify in message.

void _UserError(char FAR *message)
char FAR *message;         /* Error message. */


The Visual FoxPro internal code for this error is 98. The code returned by the Visual FoxPro ERROR(В ) function is 1098. The Visual FoxPro MESSAGE(В ) function returns to the user your specified message. Control is passed to the Visual FoxPro error handler and doesn't return.

Do not call _UserError() in a CALLUNLOAD routine: the library will not load, due to the _UserError() call, and no message will be displayed.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.


The following example calls _UserError(В ), demonstrating that execution doesn't return to the API routine after _UserError(В ).

Visual FoxPro Code

В Copy Code

C Code

В Copy Code
#include <pro_ext.h>

FAR UserErrorEx(ParamBlk FAR *parm)
   _UserError("This is a _UserError() example.");
   _PutStr("This should never be displayed.");

FoxInfo myFoxInfo[] = {
   {"EXAMPLE", (FPFI) UserErrorEx, 0, ""},
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

See Also

JavaScript Editor js editor     Web development