>Does anyone know why only sometimes, maybe 1 out of 100 times I'll get the above error message in my shutdown procedure?
>
>
procedure CloseForms
>local i
>
>for i = _screen.FormCount to 1 step -1
> if ( _screen.Forms[i].QueryUnload() )
> _screen.Forms[i].Release()
> else
> _screen.Forms[i].Activate()
> endif
>endfor</b>
>
>None of the forms in the app ever return .f. from QueryUnload()
>
>df
David,
What might be happening (and this is a guess) is because of the way, you're releasing the FormCount value is diminishing as you go. You might be hitting:
_SCREEN.Forms[0]
Which might cause this error. Trying assigning the .FormCount property to a variable and use that to count the number of times the loop needs to iterate.
George
Ubi caritas et amor, deus ibi est