June 2006
Intermediate to advanced
1344 pages
42h 52m
English
The following examples demonstrate different ways of varying the control variable in a For...Next statement. In each case, we write the appropriate For...Next header.
Vary the control variable from 1 to 100 in increments of 1.
For i = 1 To 100 or For i = 1 To 100 Step 1
Vary the control variable from 100 to 1 in increments of -1 (decrements of 1).
For i = 100 To 1 Step -1
Vary the control variable from 7 to 77 in increments of 7.
For i = 7 To 77 Step 7
Vary the control variable from 20 to 2 in increments of -2 (decrements of 2).
For i = 20 To 2 Step -2
Vary the control variable over the sequence of the following values: 2, 5, 8, 11, 14, 17, 20.
For i = 2 To 20 Step 3
Vary the control variable over ...
Read now
Unlock full access