OBJECT GETTYPE()

From Recital Documentation Wiki
Revision as of 12:39, 27 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Get the data type of a value passed to a method


SYNONYM

None


SYNOPSIS

#include "dbapi.h"
 
OBJECT_GETTYPE()
 
<input parameters>
None
 
<output parameters>
None


DESCRIPTION

The OBJECT_GETTYPE() macro is used to return the data type of a value passed to a set property method.


EXAMPLE

The following example gets the data type of the value passed to the set property method of the ObjValue property in a class called clsMyClass.

Example Recital program:

test = newobject("myclass")
// Instantiate an EXCEPTION object and assign it to the property ObjValue 
test.objvalue=newobject("exception")

Example in 'C' object:

#include "dbapi.h"
 
/* define set property method */
DEFINE_PROPERTYSET(clsMyClass, ObjValue)
{
	struct example_data *objectData = (struct example_data *)OBJECT_GETDATA();
	OBJECT	objvalue;
	int		rc = OBJECT_ERROR;
 
	if (OBJECT_GETTYPE() == 'O') {
		objvalue = OBJECT_GETOBJECT(); 
		objectData->prop_objvalue = OBJECT_ASSIGN(objvalue, objectData->object_name);
		rc = OBJECT_SUCCESS;
	}
 
	return(rc);
}


SEE ALSO

DEFINE_CLASS(), 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_GETVALUE(), OBJECT_NEW(), OBJECT_RETERROR(), OBJECT_RETPROPERTY(), OBJECT_RETRESULT(), OBJECT_SETARG(), OBJECT_SETDATA(), OBJECT_SETPROPERTY()