Hi Tracy, Thanks for your reply.
The main purpose is , if there are any open forms, not to Quit the App.
I still want the user to actually close the forms, I just want to do a test.
If any open forms
Messagebox('There are Open Forms..you cannot exit')
Dont Quit
Endif
But I was getting up a count of 4 when it appears to me that there are no open forms
regards,
Gerard
>Is the goal to close all open forms? Or just check the number of open forms?
>
>
>LOCAL lnForms, llDone
>lnForms = _SCREEN.FORMCOUNT
>llDone = .T.
>DO WHILE lnForms > 0 AND llDone
> llDone = _SCREEN.FORM(lnForms).QUERYUNLOAD()
> IF llDone
> _SCREEN.FORM(lnForms).RELEASE
> lnForms = lnForms - 1
> ENDIF
>ENDDO
>
>
>
>>Hi.
>>I have a button which allows exit out of an app, but before I do so I check _Screen.FormCount to check the no. of open forms.
>>
>>This .most of the time returns 4 when I have no open forms, but all I have open is A Menu and a Toolbar.
>>
>>Is this the right command or is there a better way. ?
>>
>>Regards,
>>
>>Gerard