O'Reilly logo

VBScript in a Nutshell, 2nd Edition by Ron Petrusha, Matt Childs, Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

IsArray Function

Syntax

IsArray(varname)
varname

Use: Required

Data Type: Any

The name of the variable to be checked.

Return Value

Boolean (True or False).

Description

Tests whether a variable is an array.

Rules at a Glance

If the variable passed to IsArray is an array or contains an array, True is returned; otherwise, IsArray returns False.

Programming Tips and Gotchas

Due to the nature of variants, it isn’t always obvious if a variant variable contains an array, especially if you pass the variant to a function, and the function may or may not attach an array to the variant. Calling any of the array functions — such as LBound or UBound—or trying to access an element in an array that doesn’t exist will obviously generate an error. In these situations, you should first use the IsArray function to determine whether you can safely process the array.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required