Welcome to the Rhino 7 version of this page! Looking for the newer Rhino 8 WIP version?

Is Dynamic Array Dimensioned

Demonstrates how to determine of a dynamic array has been dimensioned.


' Returns a Boolean value indicating whether an
' array has been dimensioned - determine
' whether or not the array has an upper bound.
Function IsUpperBound(ByVal arr)
  IsUpperBound = False
  If IsArray(arr) Then
    On Error Resume Next
    UBound arr
    If Err.Number = 0 Then IsUpperBound = True
  End If
End Function