Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form object not exist but Screen Active Form does
Message
From
28/01/2000 05:59:32
 
 
To
28/01/2000 05:34:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00302767
Message ID:
00323988
Views:
63
>>'MyName' disappears in at least two ways. One is that you destroy the object, and all references to it in all contexts. It ceases to be. It is an exc-parrot in proper Phyton terminology.
>
>now that appears to conflict with what Jim just said. I quote:
>
>"The reference will NOT automatically go out of scope on object destruction, as a matter of fact, the reference will prevent the object from being destroyed if it is still in scope. "
>
>or am I misunderstanding what either of you are trying to say?
>

the object is deceased - it is a dead object. Any variables that pointed to it after it is released still exist, and they are still objects, but they are null objects. The variables are still there but null if the object dies.

If you wipe out all object references, the object dies. the problem is that you don't have all the object refwerences neatly in hand - forms are a special case in and of themselves, because unless there is a LINKED behavior carried in from the DO FORM statement, you can wipe out explicit refs til the cows come home. There's still that hidden ref in the _SCREEN.Forms collection that needs to be wiped out, and since the _SCREEN.Forms collection is read-only, you need to triggeer the release of the form, but are satisfied that will kill it, but of course the memvars still exist, and still are objects, but being null, if all you do is test TYPE("myvarname") it returns "O", and meltdowns happen. It's the VFP equivalent of Sloppy C Programmer syndrome, where I do a malloc() to get a pointer to a new block of memory, don't check to make sure it's not null before trying to use it, and write to it - and plop goes the proggy with a memory access error!

IOW, if an object dies, the memvars that point to it don't disappear, they become null. And in the case of a form, even if all the explicit memvar object pointers are gone, there's still the nasty little thing in the _Screen.Forms collection keeping the form from dying because there is no longer any pointer to it. Because there's still a pointer to it in the collection.
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
Next
Reply
Map
View

Click here to load this message in the networking platform