Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:scriptsamples:isupperbound [2015/09/14] (current)
Line 1: Line 1:
 +====== Determine of a Dynamic Array has been Dimensioned ======
 +> **Developer:​** //​[[developer:​rhinoscript|RhinoScript]]//​
 +> **Summary:​** //​Demonstrates how to determine of a dynamic array has been dimensioned.//​
 +
 +=====Question=====
 +How can I determine whether or not a dynamic array has been dimensioned?​
 +
 +=====Answer=====
 +
 +See the example code below.
 +
 +<code vb>
 + '​ 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
 +</​code>​
 +
 +
 +{{tag>​Developer RhinoScript}}
  
developer/scriptsamples/isupperbound.txt ยท Last modified: 2015/09/14 (external edit)