>You should get type('objectname') = 'U' or other than 'O' if the object is not present.
>Rajesh
Unfortunately you can't just use type = "O" as a test.
Try this:
loObj = CREATEOBJECT("Form")
loObj = .NULL.
? TYPE("loObj")
Gives "O", even though the object no longer exists.
Either use:
IF TYPE("loObj") = "O" AND NOT ISNULL( loObj)
OR check the name property, which will only exist if the object does. Also this makes the code slightly shorter.
IF TYPE("loObj.Name") = "C"