Here's another way to write the same code (a little more clear, IMO):
FOR EACH loForm IN _SCREEN.Forms
IF loForm.Name = "MAIN"
WAIT WINDOW "Hey...there's a form with the name 'NAME' open"
EXIT
ENDIF
ENDFOR
Vlad
>FOR i = 1 TO _SCREEN.FormCount
>IF _SCREEN.Forms(i).Name="MAIN"
> WAIT WINDOW "Hey...there's a form with the name 'NAME' open"
> EXIT
>ENDIF
>ENDFOR
>
>Hope this or some permutation of this helps!