Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

IsObject

Returns a value indicating whether an expression references a valid Automation object.

Synopsis

IsObject(expression)

Arguments

The expression argument can be any kind of expression (such as a numeric or string expression).

Description

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.

Examples

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

FeedbackOpens in a new tab