Example - UBound Function
This example demonstrates some of the features of arrays. By default the lower bound for an array is 0 unless its option base is sets it to something else. You will get an error if you set Option Base to 1. This is because the script is written to use 0 as the first index.
Option Base 0 Sub Main() Dim a(10) As Double MsgBox "LBound: " & LBound(a) & " UBound: " & UBound(a) Dim i As Integer For i = 0 to 3 a(i) = 2 + i * 3.1 MsgBox a(i) Next i Msg = a(0) &","& a(1) &","& a(2) &","& a(3) MsgBox Msg End Sub