DEFINE PROPERTYGET()

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

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

PURPOSE

A macro to define a method to get the value of a property


SYNONYM

None


SYNOPSIS

#include "dbapi.h"
 
DEFINE_PROPERTYGET(classname, propertyname)
 
<input parameters>
constant		classname;	/* Class name that contains the property	*/
constant		propertyname;	/* Property name to define 		*/
 
<output parameters>
none


DESCRIPTION

The DEFINE_PROPERTYGET() macro is used to define a method to get the value of a property from a class that can be accessed from the Recital 4GL.


EXAMPLE

The following example defines a method to get the value of the property called NumValue for the class clsMyClass.

Example Recital program:

test = newobject("myclass")
// Display the value of the property NumValue
? "numvalue", test.numvalue

Example in 'C' object:

#include "dbapi.h"
 
/* Define get property method */
DEFINE_PROPERTYGET(clsMyClass, NumValue) 
{
	struct example_data *objectData = (struct example_data *)OBJECT_GETDATA();
 
	if (objectData == NULL) return(-1);
 
	OBJECT_RETPROPERTY('N', objectData->prop_numvalue);
}


SEE ALSO

DEFINE_CLASS(), DEFINE_METHOD(), 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_RETERROR(), OBJECT_RETPROPERTY(), OBJECT_RETRESULT(), OBJECT_SETARG(), OBJECT_SETDATA(), OBJECT_SETPROPERTY()