Difference between revisions of "NEWOBJECT()"
From Lianjapedia
Helen.george (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 6: | Line 6: | ||
==See Also== | ==See Also== | ||
− | [[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS() | + | [[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DEFINE CLASS]], [[DISPLAY CLASSES]], [[DODEFAULT()]], [[FOREACH]], [[LIST CLASSES]], [[LOADOBJECT()]], [[OBJECT()]], [[PRINT_HTML()]], [[PRINT_JSON()]], [[PRINT_R()]], [[PRINT_XML()]], [[REMOVEPROPERTY()]], [[REQUIRE_ONCE()]], [[SAVEOBJECT()]], [[SQL SELECT]], [[WITH]] |
==Description== | ==Description== | ||
Line 33: | Line 33: | ||
</code> | </code> | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Objects]] | [[Category:Objects]] | ||
[[Category:Objects Functions]] | [[Category:Objects Functions]] |
Revision as of 12:57, 21 December 2012
Contents
Purpose
Function to create a new object
Syntax
NEWOBJECT(<expC1> [, <exp1>, <exp2>, ...]]])
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, LIST CLASSES, LOADOBJECT(), OBJECT(), PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, WITH
Description
The NEWOBJECT() function is used to create a new object. The <expC1> is the class on which the new object is based. Optionally, parameters can be passed to the object's init method in <exp1>, <exp2>, ... .
The NEWOBJECT() function returns a reference to the newly created object.
Example
class opentable property cAlias property nRecnum procedure init(pAlias) use &pAlias this.cAlias = pAlias endproc procedure nRecnum_access this.nRecnum = recno() endproc endclass oCompany = newobject("opentable","example") ? oCompany.nRecnum ? oCompany.cAlias