Caché Basic Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   

Returns a value indicating whether an expression references a valid Automation object.
The expression argument can be any kind of expression (such as a numeric or string expression).
Expression Evaluates To IsObject Returns
valid Object Reference 1
invalid Object Reference –1
not an Object Reference 0
IsObject returns a –1 value if expression is a reference to an invalid object. Invalid objects should not occur in normal operations; an invalid object could be caused, for example, by recompiling the class while instances of the class are active.
The following example uses the IsObject function to determine if an identifier represents an object variable:
o = New Sample.Person
Println IsObject(o)        ' Returns 1.
Println IsObject("hello")  ' Returns 0.
o = ""
Println IsObject(o)        ' Returns 0.
See Also

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA