>Hi all
>
>How to remove all open windows in an application to do the reindex routine.
>
>Txs
One way:
local lxx
for lxx = _Screen.FormCount to 1 step -1
if upper(_Screen.Forms[lxx].BaseClass) = 'FORM' then
_Screen.Forms[lxx].Release
endif
endfor
Notice you have to go backward using the Forms collection of _Screen. As you release forms, the collection is decreased by one form and at some point, you will get record out of range going forward.
Of course this doesn't check to see if the user is actually doing anything in the form. You could add a call to the form's QueryUnload and if it returns .T> then release it. Otherwise, display a message to the user to get out of what they are doing.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao