Difference between revisions of "COMPOBJ()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 22: | Line 22: | ||
<code lang="recital"> | <code lang="recital"> | ||
class myclass1 | class myclass1 | ||
− | property firstname | + | property firstname |
− | property lastname | + | property lastname |
endclass | endclass | ||
class myclass2 | class myclass2 | ||
− | property firstname | + | property firstname |
− | property lastname | + | property lastname |
endclass | endclass | ||
class myclass3 | class myclass3 | ||
− | property firstname | + | property firstname |
− | property lastname | + | property lastname |
− | property midinitial | + | property midinitial |
endclass | endclass | ||
Line 66: | Line 66: | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
+ | [[Category:Objects]] | ||
+ | [[Category:Objects Functions]] |
Revision as of 09:51, 2 June 2009
Class
Objects
Purpose
Function to compare two objects
Syntax
COMPOBJ(<object-ref1>,<object-ref2>)
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), CLASS, CREATEOBJECT(), DEFINE CLASS, DODEFAULT(), METHOD, NEWOBJECT(), REMOVEPROPERTY(), SET CLASSLIBRARY, WITH
Description
The COMPOBJ() function is used to compare the property name and property values of two objects. The <object-ref1> is a reference to the first object to be compared and the <object-ref2> is a reference to the second object. If the property names and values of the two objects are identical, COMPOBJ() will return .T. (true), if not it will return .F. (false).
Example
class myclass1 property firstname property lastname endclass class myclass2 property firstname property lastname endclass class myclass3 property firstname property lastname property midinitial endclass o1 = new myclass1() o2 = new myclass2() o3 = new myclass3() o1.firstname = "John" o1.lastname = "Johnson" o2.firstname = "Jack" o2.lastname = "Johnson" o3.firstname = "John" o3.lastname = "Johnson" ? compobj(o1,o2) // Returns .F. as firstname property has different values o2.firstname = "John" ? compobj(o1,o2) // Returns .T. as properties and values identical ? compobj(o1,o3) // Returns .F. as although firstname and lastname property is identical, o3 has a midinitial property and o1 // does not
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer