Visual Basic Language Reference  

IsArray Function

Returns a Boolean value indicating whether a variable points to an array.

Public Function IsArray(ByVal VarName As Object) As Boolean

Parameter

VarName
Required. Object variable.

Remarks

IsArray returns True if the variable points to an array; otherwise, it returns False. IsArray is especially useful with objects containing arrays.

Example

This example uses the IsArray function to check if several variables refer to an array.

Dim MyArray(4), YourArray(3) As Integer   ' Declare array variables.
Dim MyString As String
Dim MyCheck As Boolean
MyCheck = IsArray(MyArray)   ' Returns True.
MyCheck = IsArray(YourArray)   ' Returns True.
MyCheck = IsArray(MyString)   ' Returns False.

See Also

Declaring Array Variables | IsDate Function | IsDBNull Function | IsError Function | IsNothing Function | IsNumeric Function | IsReference Function | Object Data Type | TypeName Function