Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many open forms
Message
From
01/08/2003 08:02:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00815534
Message ID:
00815805
Views:
11
The best way to handle that is either to have a function that you call to open any forms that get opened and another function to close forms. Then you can add the form name to an array when you open it and delete it from the array when you close it.

Or, have the form add itself and delete itself from the array when it opens or closes.

After that what you are looking for is a snap.

Alan

>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
Previous
Reply
Map
View

Click here to load this message in the networking platform