>Hi everybody,
>
>Ok, I want to finish this problem today.
>
>This code:
>
>
> FOR lnCount = _screen.FormCount TO 1 STEP - 1
> loForm = _screen.Forms[lnCount]
,,,
> NEXT
>
>Gives form is not an object on loForm = _screen.Forms[lnCount] line.
>
>What I'm doing wrong today? I can put it in try/catch, but how can I exit gracefully?
Could it be that some code somewhere has simply set the form reference to null? Or that a form is in some sort of a limbo?
Last time I tried to write a loop like this, I kept going through this loop until there were none, or until a counter went more than initial _screen.formcount * 3. So it covered the forms which won't release because they are referenced in other forms - by releasing those other forms first, then trying the remaining ones again. And there was a try-endtry block, just in case of a limbo.