Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why closing all Forms on App Exit?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Why closing all Forms on App Exit?
Miscellaneous
Thread ID:
01684122
Message ID:
01684122
Views:
54
Hi,

I wrote (or copied it from somewhere) the code below 10 years ago. And now I don't remember it's purpose. This code is called from the method, right after the READ EVENTS, when application is being closed.
What is the purpose of closing all forms when a user wants to close the application?
I tried to comment this code and only issue ON SHUTDOWN, after READ EVENTS, and I get no error when some forms are still open. The ON SHUTDOWN seem to close these forms anyways.
	LOCAL lnForms, i, llDone
	lnForms = _screen.formcount
	FOR i = lnForms to 1 STEP -1

		IF TYPE("_SCREEN.Forms(i)") <> "O" OR ISNULL( _SCREEN.Forms(i) )
			LOOP 
		ENDIF 

		IF PEMSTATUS(_SCREEN.Forms(i), 'QueryUnload', 5) 
      		    llDone = _SCREEN.Forms(i).QueryUnload() 
      		   IF !llDone
      			RETURN .F.
      		  ENDIF 
      	      ENDIF 
 		_screen.Forms(i).Release
	ENDFOR
Thank you in advance for any input
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform