WR6K-OM-E Rev A
ISSUED: October 2003
277
To make a pause of 10 seconds you can write:
NewTime = Timer + 10.0
Do Loop Until Timer >= NewTime
where Timer is a clock function in the PC, which has a resolution of one second.
Example file for these constructions: DoLoops.Xls
While . . . Wend
This is similar to Do While . . . Loop. You can write things like:
While ( (A > 2) And (C < 92677663) )
AnyVBCalculation
Wend
For . . . Next
Sometimes you know, or you think you know, the number of times that you want to do a job. For
this case a For loop is ideal, especially when you have an array of numbers to work with.
Examples:
For K = 0 To Total
HistogramBin (K) = 0
Next
Omega = TwoPi / Period
For N = 0 To Period
Y (N) = A * Sin (Omega * N)
Next
Be careful about changing the counting variable in any loop. You can do this to terminate the loop
early (but
Exit For
is better), but you could also prevent it from terminating at all.
For emergency exit, you can use
Exit For
. For example:
For K = 0 To Total
If HistogramBin(K) = 0 Then Exit For
AnyVBScripting
Next
It is possible to make a For loop with steps greater than 1, as in the following example in which K
takes the values 3, 7, 11, 15, . . . . 83.
Summary of Contents for 6000 SERIES
Page 65: ...WR6K OM E Rev A ISSUED October 2003 63 Proper Orientation of Drive ...
Page 131: ...WR6K OM E Rev A ISSUED October 2003 129 Example ...
Page 141: ...WR6K OM E Rev A ISSUED October 2003 139 ...
Page 236: ...Operator s Manual 234 ISSUED October 2003 WR6K OM E Rev A Example 6 ...
Page 261: ...WR6K OM E Rev A ISSUED October 2003 259 ...
Page 286: ...Operator s Manual 284 ISSUED October 2003 WR6K OM E Rev A ...
Page 304: ...Operator s Manual 302 ISSUED October 2003 WR6K OM E Rev A ...
Page 307: ...WR6K OM E Rev A ISSUED October 2003 305 Convolve two signals ...
Page 348: ...Operator s Manual 346 ISSUED October 2003 WR6K OM E Rev A ...
Page 402: ...Operator s Manual 400 ISSUED October 2003 WR6K OM E Rev A ...