Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program to close all forms
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00359746
Message ID:
00399683
Views:
13
Hi Allan,

This is actually the logical.
The problem is that until all the code in click method is executed the form cannot be released. In order to execute the rest of the code in the click() method the button should exist (along with the form) and only after that the form goes away.
May be you can find more info in "Error Handling in Visual FoxPro"
by Doug Hennig at
http://www.stonefield.com/pub/errorh.zip


>Hi Nick,
>
>I tried your code below in an attempt to close all open forms in the event of an error. It works, except that, for example, if a commandbutton has the following code . . .
>
>* commandbutton.click
>
>lkkoklk && this causes error
>
>=messagebox("This darned messagebox still appears - then the form closes",16,"WHY WHY WHY")
>
>* end of commandbutton.click
>
>Your code example, placed in my global error handler, successfully releases all open forms (which is what I want to accomplish) with the exception of the form that caused the error, it then returns to the form.commandbutton.click event and runs the second line of code on this form - BEFORE releasing this last form in the collection. What I want it my app to do is release the form right after the line of code that contains the error:
>
>lkkoklk && this causes error
>
>Any ideas as to how to get rid of the form.commandbutton.click from the call stack so that the form will close without running the second line of code?
>
>
>>Or, if there is no code in QueryUnload it can be just like this:
>>
>>ln = _screen.formcount
>>FOR i = ln to 1 STEP -1
>>_screen.Forms(i).Release
>>ENDFOR
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform