Difference between revisions of "SDK ERROR()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 14: | Line 14: | ||
<input parameters> | <input parameters> | ||
− | int number; /* Error number | + | int number; /* Error number */ |
char *message; /* Address of a buffer containing error message */ | char *message; /* Address of a buffer containing error message */ | ||
Latest revision as of 12:09, 30 March 2009
PURPOSE
Used to define and signal a user-defined error
SYNONYM
api_error()
SYNOPSIS
#include "dbapi.h" void ERROR(number, message) <input parameters> int number; /* Error number */ char *message; /* Address of a buffer containing error message */ <output parameters> none
DESCRIPTION
The ERROR() function is used to define and signal a user-defined error. When the ERROR() function is called, a run-time error occurs and the current error handler will be called. The current error handler is an active ON ERROR <command>, a TRY...CATCH block, or the default Recital error handler which creates an error.mem file.
EXAMPLE
The following example calls the error handler if the wrong number of parameters has been passed.
Example Recital program:
if pcount() <> 3 error 10000, "Invalid parameter count" endif
Example 'C' function:
#include "dbapi.h" dbapi_checkparams() { if (PCOUNT != 3) { ERROR(10000, "Invalid parameter count"); } }