Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close all active forms?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01314968
Message ID:
01314984
Views:
15
This message has been marked as the solution to the initial question of the thread.
Do you have any code in the release or the queryunload that prompts the user for an input? If not then you can try something like:
llokay = .T.
FOR EACH loForm IN _VFP.FORMS
	IF VARTYPE(loForm) = "O"
		IF loform.QUERYUNLOAD()
			loForm.RELEASE()
		ELSE
			STORE .F. TO llokay
		ENDIF
	ENDIF
ENDFOR
IF !llokay
	=MESSAGEBOX('An Error Ocurred Attempting to Exit.',0+16+4096,'ERROR')
	RETURN TO MASTER
ENDIF
Otherwise, you might have to try something like:

DECLARE Integer ExitProcess IN Win32API
ExitProcess()



>I'm trying to find and close all active forms. the problem is during run time form names are not used also there may be several forms with the same name. What is the correc way of doing this?
>
>
>LOCAL lnFormCount, k, dum
>
>*-- get a active form count
>lnFormCount = _screen.FormCount
>
>*-- get non found getout
>IF lnFormCount = 0
>	RETURN
>ENDIF
>
>*-- close all forms
>FOR k = lnFormCount TO 1 STEP -1
>	
>	dum = ALLTRIM(_screen.Forms(k).name) + '.Release()'
>	&dum
>	
>next
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform