PRB: Operator/Operand Type Mismatch When Comparing Two ObjectsID: Q126780 3.00 WINDOWS
The information in this article applies to:
SYMPTOMSThe 'Operator/Operand Type Mismatch' error is returned when comparing two objects with the equal sign (=) operator.
CAUSEThe equal sign operator is used to compare character, logical, date, or numeric data. When the variable is an object reference, the equal sign is the assignment operator. The equal sign is used to create a reference to an object. It should not be used to compare objects.
WORKAROUNDUse the COMPOBJ() function to compare two objects. The COMPOBJ() function compares the properties of an object. It returns .T. if the properties and property values of two objects are identical.
STATUSThis behavior is by design.
MORE INFORMATIONThe following example illustrates the use of the COMPOBJ() function. It compares two objects created with the SCATTER NAME command. To run this example, copy the following code into a new program file (*.PRG) and run it.
NOTE: 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.
Additional reference words: VFoxWin 3.00 errmsg err msg
KBSubcategory: FxprgGeneral
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |