DIAdem Help

Method: UBound for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: UBound for VBS

Specifies the largest available index of an array.

vUBound = Object.UBound(arrayname, [Dimension])
ObjectVBS
Object with this method. You do not need to specify this object.
arraynameVariant
Specifies the name of the array. You can enter the dimension as an optional parameter. Use the value 1 for the first dimension, the value 2 for the second dimension, and so on.
[Dimension]Specifies the dimension of the array for which DIAdem returns the smallest index. If you do not enter a value, DIAdem uses the first dimension.
vUBoundVariant
Receives the largest available index of an array.

The following example specifies the largest available index of an array:

Dim MyArray
MyArray = Array("This","is","an", "example")
Call MsgBox(UBound (MyArray))   ' Returns 3

Related Topics

Array | Dim | Private | Public | ReDim | IsArray | Erase | LBound | UBound