NEW: Welcome to the Rhino 6 version of this page! Looking for the older Rhino 5 version?

Is Dynamic Array Dimensioned

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

VBScript

' 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