Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about handling Forms
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00191274
Message ID:
00191333
Views:
19
>CLEAR EVENTS
>FOR x=1 TO _SCREEN.FormCount && This loop could be FOR EACH oFrm in _SCREEN.Forms like David's
> _SCREEN.Forms[m.x].Release
>ENDFOR
>DO CloseData && Closes tables opened at main.prg start
>DO ResetEnvir && Resets SET commands for my development preferences
>RETURN
>Cheers,

Rich,

Both your and Dave's code will fail under certain situations. For example, when three forms are open;

Your code will close form 1, then advance to form 2, hwoever after form 1 closes form 2 is now 1 and 3 is now 2. You close the enw form 2 and then advance to form 3, the problem now there is no form 3 to close and you get an error or at least leave form 3 open. Instead the call to the release in your code should always do _screen.forms(1).Release(), as the forms will advance in the forms collection as they are closed.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform