_UserError( ) API Library Routine Example

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

Visual FoxPro Code

SET LIBRARY TO EXAMPLE
= EXAMPLE()

C 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
};