Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close All Forms
Message
From
04/08/2005 22:17:08
John Tomblin
Service Station Systems, Inc.
San Jose, California, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Close All Forms
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01038798
Message ID:
01038798
Views:
55
Before opening form X, I need to make sure that all other forms are closed including other instances of form X. Putting the following code in the load of the form doesn't work.

for Ctr = 1 to _Screen.FormCount
release windows (_Screen.Forms(Ctr).Name)
endfor

This doesn't gracefully close the forms. That is, it just removes the forms from memory leaving various objects, cursors, variables, etc. So I tried the following:

for Ctr = 1 to _Screen.FormCount
_Screen.Forms(Ctr).Name.release
release windows (_Screen.Forms(Ctr).Name)
endfor

That produces a pile of errors.
I also tried moving this code to a seperate procedure with a "do form ..." after it which produced similar results and problems.

Any ideas?
Next
Reply
Map
View

Click here to load this message in the networking platform