PRB: Error When Using Assign Method to Assign Object References (208212)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q208212 SYMPTOMS
The following error message appears when using an assign method to store object references in a property and then trying to access properties of that object through the property:
Unknown member <property name>
CAUSE
The assign method fires twice when assigning an object reference to a property. The first time it fires, it sets the value of the property containing the object reference to NULL and then it runs again and assigns the property the object reference.
RESOLUTION
In the assign method, check to see if the new value is not NULL before assigning it to the property.
In the program code in the "Steps to Reproduce Behavior" section below, look in the class definition of the Test class and uncomment the IF...ENDIF block code as shown to check the new value. It is in the Procedure obj_assign:
* IF !ISNULL(m.vNewVal) && uncomment this to make things work.
THIS.obj = m.vNewVal
* ENDIF
Modification Type: | Major | Last Reviewed: | 11/18/1999 |
---|
Keywords: | kbCodeSnippet kbDSupport kbOOP kbprb KB208212 |
---|
|