UBound: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:
== Related Items ==
== Related Items ==


[[array|ARRAY]], [[dim|DIM]], [[lbound|LBOUND]], [[redim|REDIM]]
[[array|Array]], [[dim|Dim]], [[lbound|LBound]], [[redim|ReDim]]


[[Category:Language Reference]]
[[Category:Language Reference]]

Revision as of 01:50, 24 August 2012

UBound(array[, dimension])

Description

UBound returns a long value specifying the largest available subscript in the specified dimension of a given array. The required parameter, array, is any array variable. The optional parameter, dimension, specifies which dimension's upper bound is returned, beginning with the default, 1.

Example

Rem UBound Example
'UBound returns upper bound of array dimension
Dim Other, Children(3), Parents(3, 1)
Other = Array("Damien", "Pip", "Wendy")
Print "'Other' Upper Bound:", Ubound(Other)
Print "'Children' Upper Bound:", _
       UBound(Children, 1)
Print "'Parents' Upper Bounds:", _
       UBound(Parents), UBound(Parents, 2)

Output

'Other' Upper Bound:2
'Children' Upper Bound:    3
'Parents' Upper Bounds:    3      1

Related Items

Array, Dim, LBound, ReDim