Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I the only one who did not know this?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Am I the only one who did not know this?
Miscellaneous
Thread ID:
00436744
Message ID:
00436744
Views:
93
The click method of an okay button on a modal form I had the following code.

Procedure cmdOkay.Click
Local lcFile,lcType...

With This.Parent && The parent is the modal form
lcFile=.txtMergeFile.Value
lcType=.comMergeType.Value
EndWith
*
*Code to do the merging
*

...

ThisForm.Release
EndProc

The form never released when the merging finished and the Release method was called. Obviously there was a dangling object reference somewhere. The only problem was I never refered to any objects in my code.

However, when I changed "With This.Parent" to "With Thisform" everything worked fine. I am assuming that the "EndWith" does not clear any objects referenced
by the "With" command. Am I correct in my understanding? Did anyone else know this already?

Thanks
Simon
Simon White
dCipher Computing
Next
Reply
Map
View

Click here to load this message in the networking platform