Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalents for WONTOP() etc?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00234472
Message ID:
00235140
Views:
26
>>
>>Every once in awhile, you have to wait for the system (operating and otherwise) >to complete its chores before you can go ahead with your's. I suspect that's >what you're seeing here. When I've encountered such things, I've inserted a >timing loop.
>
>they won't believe that either!
>
>I think, however, in my case its just a case of calling the routine at the wrong point in the release process. I'm trying to do a cleanup routine which releases any forms which haven't already been released (is this even necessary I suppose I should ask - or can we just issue a cancel or quit regardless and the system closes everything down for us?)
>
>Anyway, for what its worth, I simple check for whatever form is 'wontop()' and call its release method. No problem except for some I'm just closing which come up as being wontop() but then when you call the release method, we get the message that it's no longer an object. Yet if we suspend at that point, not only is it wontop() but it also returns .t. for wexist. The giveaway that its in the process of disgorging itself is that its form name now has a null value rather than 'object'.
>
>I can't wrap my head around the concept of an object which has ceased to exist in memory but still tells the system it is the currently active window!
>
Hi Harry,

The situation I encountered when I had to insert the timing loop involved activating a form that wasn't topmost. The problem was that the form had to be completely on top. The code that activated the form wouldn't produce the correct results if it weren't. Remember that VFP, tells the system to do this and goes on its merry way, regardless of whether or not the action has been completed.

I found something similiar with WEXIST() still returning .T. in the debugger even after the form had been released. When I minimized, then restored it, the debugger showed .F.

Here's an idea if you're using VFP 6.0. If you wrap the form object in another object, say a Session, and create an object reference as a custom property of it, you can add an _Assign event for the form object. _Assign will fire whenever the object reference is assigned. When the form is released, the parameter coming into the event will be .NULL., you can then use this as an indicator to do you're cleanup chores. You don't have to fool around with WEXIST() and have to worry about timing problems either.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform