Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling
Message
From
25/11/1998 08:45:38
 
 
To
25/11/1998 02:58:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00161252
Message ID:
00161304
Views:
17
>Hi.
>I have a problem of closing of the forms in the application.
>When there is an error the procedure "onerror" registers it... Brings in dbf.. And after that it is necessary to close all forms in the application, but NOT QUIT the application...
>
>My code
>LOCAL i
>FOR i = 1 TO _screen. Formcount
> IF _screen.forms (i) .BaseClass = " Form"
> _screen.forms (i) .release ()
> ENDIF
>ENDFOR
>
>BUT!!!!... I use DEBUGRER. After execution of the given code I see again call to a method "RESIZE" of the form called an error, after that, I come back in the procedure which has called an error... That after _screen.forms (i).release () almost each line of the code produces errors... Alias not found etc...
>How to make so that in forms were fulfilled no one of its methods, and at once to proceed to READ EVENTS?
>If there is a solution.. Prompt where to look it ...
>Thank.

It's problem with Forms collection. When you release one member of this collection it shrinks automatically shifting other members position. The solution is to start from the highest number, i.e. FOR _SCREEN.Formcount TO 1 STEP -1. Another way, pretty common, is to have your own form manager(s) (collection) which will behave better.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform