Article ID: 126780
Article Last Modified on 2/12/2000
USE SYS(2004)+'\samples\data\customer' SCATTER NAME ocust1 && Creates a custom object ocust1 SCATTER NAME ocust2 && Creates a custom object ocust2 Ccompare=IIF(COMPOBJ(ocust1,ocust2),'True','False') * Test if objects are identical WAIT WINDOW "Compobject returned " + CcompareNOTE: Classes have default properties that can be set when an object is instantiated. For example, when a form is instantiated, the values of CAPTION and NAME properties, among other properties, are set to a unique value. The following example illustrates the fact that COMPOBJ() will return .F. if the values of these properties are not modified. Use the AMEMBERS() function to verify the names and infer the values of properties, procedures, and member objects of an object.
frmtest1= CREATEOBJECT('form') && Creates an instance of a form
frmtest2 = CREATEOBJECT('form') && Creates an instance of a form
Compare= IIF(COMPOBJ(frmtest1,frmtest2),'True','False')
WAIT WINDOW "Compobj returned " + Compare
* In this case, COMPOBJ returned .F. Some property values are not
* identical
? frmtest1.name && Returns Form<n>, where n is a number
? frmtest2.name && Returns Form<n+1>, where n is a number
frmtest1.name="mytest"
frmtest2.name="mytest"
? frmtest1.caption && Returns Form<n>, where n is a number
? frmtest2.caption && Returns Form<n+1>, where n is a number
frmtest1.caption= "This is a test"
frmtest2.caption= "This is a test"
?COMPOBJ(frmtest1,frmtest2) && Returns .T.
Additional query words: VFoxWin errmsg err msg
Keywords: kberrmsg kbcode KB126780