Method: UBound for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: UBound for VBS
Method: UBound for VBS
Specifies the largest available index of an array.
vUBound = Object.UBound(arrayname, [Dimension])
| Object | VBS Object with this method. You do not need to specify this object. |
| arrayname | Variant 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. |
| vUBound | Variant 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
See Also
Related Topics
Array | Dim | Private | Public | ReDim | IsArray | Erase | LBound | UBound