Hei Mårten
You should be able to do it this way:
FOR i = _SCREEN.FormCount TO 1 STEP -1
_SCREEN.Forms(i).Release()
ENDFOR
I think I've seen somewhere that the toolbar always will be first in _screen.Forms. If this is not the case, you could test for this and release it last.
Arne
>I have just upgraded from VFP3 to VFP6 and are now doing some changes in my program to make it work in VFP6. And the problem I have is when i'm closeing down my application and I run the following code:
>
>nFormCount = _screen.formcount
>
>for i = 1 to nFormCount
> _screen.activeform.release()
>endfor
>
>in VFP3 it worke'd just fine, but now it seem like _screen.formcount counts my toolbar as a form to and then the _screen.activeform.release() gives the following errormessage "ACTIVEFORM is not an object". How can I get around this? (The toolbar has to be closed last becouse otherwise my forms will complain).
>
>Thanks in prior!
>
>/Mårten Törnquist (marten@megasol.se)