SDA Operator’s Manual
SDA-OM-E Rev H
259
Loop While D <= Pi
Do While Y >=Z
AnyVBSCalculation
Loop
These constructions enable you to make the test before or after the calculation. If the test is made
before, the calculation might not even be done one time (if the condition for terminating were
already true). With the condition at the end, the calculation is done at least one time.
Sometimes you might want to exit the loop from somewhere inside: for example, if some kind of
problem is looming, such as the logarithm of a negative number.
For this case, you can use
If . . . . Then Exit Do
.
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.
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
Содержание SDA
Страница 1: ...SERIAL DATA ANALYZER OPERATOR S MANUAL December 2007 ...
Страница 148: ...Standard Horizontal Parameter Help Markers Standard Vertical Parameter Help Markers 148 SDA OM E Rev H ...
Страница 223: ...SDA Operator s Manual Example 6 SDA OM E Rev H 223 ...
Страница 225: ...SDA Operator s Manual SDA OM E Rev H 225 ...
Страница 232: ...In this figure the panel has been pasted onto the Excel sheet for comparison 232 SDA OM E Rev H ...
Страница 243: ...SDA Operator s Manual This example used the CORREL Array1 Array2 function of Excel as depicted below SDA OM E Rev H 243 ...
Страница 246: ...246 SDA OM E Rev H ...
Страница 247: ...SDA Operator s Manual Excel Example 5 Using a Surface Plot SDA OM E Rev H 247 ...
Страница 279: ...SDA Operator s Manual Convolving two signals SDA OM E Rev H 279 ...
Страница 310: ...The jitter wizard is accessed from the Analysis drop down menu 310 SDA OM E Rev H ...
Страница 327: ...SDA Operator s Manual SDA OM E Rev H 327 ...
Страница 328: ...328 SDA OM E Rev H ...
Страница 394: ...394 SDA OM E Rev H ...
Страница 395: ...SDA Operator s Manual SDA OM E Rev H 395 ...