IsObject Function

Purpose

Returns a Boolean value indicating whether a variable represents an Object.

Syntax

Bool = IsObject(varname)

Description

IsObject is useful in determining whether a Variant is of VarType basObject. This could occur if the Variant actually references (or once referenced) an object, or if it contains Nothing.

IsObject returns True if identifier is a variable declared with Object type, or if identifier is a OCX variable. IsObject returns True even if the variable has been set to Nothing.

Use error trapping to be sure that an object reference is valid.

Example

OpenW 1

Ocx TextBox tb2

Local a As Variant, b$

Print IsObject(tb2)// True

a = tb2

Print IsObject(a// -1

b$ = tb2

Print IsObject(b$) // False

See Also

IsDate, IsEmpty, IsError, IsMissing, IsNull, IsNumeric, IsObject

{Created by Sjouke Hamstra; Last updated: 10/10/2014 by James Gaite}