Hi Jim ---
Yes, TYPE can get screwy but I don't think VARTYPE does. Again, if VARTYPE returns an "O", the object lives. If it returns anything else, like a "U" or "X" the object either hasn't been instanced or it's been released. The original question was how to determine if an object has been instanced yet.
Of course, if we manage our apps the right way we don't need no steenkin VARTYPE to determine which objects are open or not :-D
>>IF VARTYPE(oMyObject) = "O" && It's an object
>
>John,
>
>This will fail on certain circumstances, for example;
>
>
>oObj = CReateObject("Form")
>? TYPE("oObj")
>?TYPE("oObj.Name")
>oObj = NULL
>?TYPE("oObj")
>?TYPE("oObj.Name")
>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05