OBJECT RETERROR()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Return an error


SYNONYM

None


SYNOPSIS

#include "dbapi.h"
 
OBJECT_RETERROR(message)
 
<input parameters>
char			*message;	/* Error message to return */
 
<output parameters>
None


DESCRIPTION

The OBJECT_RETERROR() macro is used to return an error from a user defined class in an OBJARG format.


EXAMPLE

The following example will call OBJECT_RETERROR() as the property passed is unknown.

Example Recital program:

test = newobject("myclass") 
// A error will be returned as the property is unknown
? test.unknown_property

Example in 'C' object:

#include "dbapi.h"
 
DEFINE_CLASS(clsMyClass)
{
	/* Dispatch factory methods and return */
	 DISPATCH_FACTORY();
 
	 /* Dispatch constructor and return */
	 DISPATCH_METHOD(clsMyClass, Constructor);
 
	 /* Dispatch destructor and return */
	 DISPATCH_METHOD(clsMyClass, Destructor);
 
/* If message not found return error */
	OBJECT_RETERROR("Unknown message type");
}


SEE ALSO

DEFINE_METHOD(), DEFINE_PROPERTYGET(), DEFINE_PROPERTYSET(), DISPATCH_FACTORY(), DISPATCH_METHOD(), DISPATCH_PROPGET(), DISPATCH_PROPSET(), OBJECT_ASSIGN(), OBJECT_DELETE(), OBJECT_GETARG(), OBJECT_GETARGC(), OBJECT_GETDATA(), OBJECT_GETOBJECT(), OBJECT_GETPARAMETER(), OBJECT_GETPROPERTY(), OBJECT_GETTYPE(), OBJECT_GETVALUE(), OBJECT_NEW(), OBJECT_RETPROPERTY(), OBJECT_RETRESULT(), OBJECT_SETARG(), OBJECT_SETDATA(), OBJECT_SETPROPERTY()