Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I compare this?
Message
From
09/03/1998 10:40:47
 
 
To
09/03/1998 02:53:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00083306
Message ID:
00083402
Views:
23
What you're doing is comparing the object reference, which won't do much good. I assume what you've done is actually something like: * Assume a property ioMySelfRef of ThisForm * thisform.ioMySelfRef = this ... * Later, in another method of the embedded object (so context is maintained) IF thisform.ioMySelfRef == this ... The above code checks to make sure you're in the same control on the form since you examine the pointer to the object. You aren't checking the -content- of the object, but the -pointer- to the object. If the context of 'this' in code relative to the parent control remains the same, the pointer stays the same unless you redefine the instantiation of the object. You need to make a copy of the object decoupled from the current object, and check the content, since the following will always be true: this.visible = .T. oRefPointer = thisform this.visible = .F. *control disappears oRefPointer.visible = .T. *control, not a copy of the control, reappears *oRefPointer. will always be the same as this. *unless the object itself is released and recreated without resetting oRefPointer, *or the context of 'this' is changed. Save copies of the properties and compare them, not the pointer to the object. > >Help! >I have stored the value of this to a custom property on my form which I then compare, using; > >if thisform.surrounded==this > >basically checking that the original value is either the same or not. >This code I should add is in the mousemove event of my controls. > >Anyone keen to tell me the *right* way? < S > > >Cheers >John > Attachment Converted: Edward M Rauh.vcf
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform