How do I execute an expression in a loop?

Here is an example of a simple (For...Next) loop. The loop is used to fill array x with values between 1 and 10.

' This program illustrates simple assignments of
' values to array elements.

Sub Main

Dim i As Long
Dim
x(10) As Double
' Note that array x is zero-referenced by default;
' i.e., the first element in array x is x(0), and
' not x(1). Do not include the statement:
'     Option Base 1
' at the beginning of this program file, or else the
' program will not run.

For
i = 0 To 10
x(i)=i

Next
i

End Sub