258
SDA-OM-E Rev H
If you find that you are building up a rather complicated set of Ifs, you might want to consider the
Select Case construction.
Select Case
This is a very powerful construction, which is also easy to understand when written out. It is best
for Integers and Strings, where exact values are always obtained. Here is a simple example:
Select Case K
Case 7 : Y = 6 : Z = 3
Case 7 : Y = Sqr (Sin (A) ) : Z = Sqr (Cos (A) )
Case N : Z = Y + X
Case Else :
End Select
Case N assumes that the value of N has already been set. Case Else is included to cover other
cases, whether foreseen or not. It should always be included.
You can also provide lists of values.
Select Case K
Case 1, 2, 3, 5, 8, 13 : Y = 55 : Z = 89
Case 4, 9, 16, 25, 36 : Y = Sqr (Sin (A) ) : Z = Sqr (Cos (A)
)
Case 7, 15, 31, 63, 127 : Z = Y + X
Case Else : Z = 3
End Select
Case N assumes that the value of N has already been set. Case Else is included to cover other
cases, whether foreseen or not. It should always be included.
Select Case is much neater than a string of Ifs and Elses, but remember: You cannot use Select
Case unless you are sure of exact equality, which allows you to compare integers and strings
only. You cannot put Case > 5, for example.
Summary of Select Case . . . . End Select
SelectCase VariableName
Case Alist : VBScriptingA
Case Blist : VBScriptingB
. . . .
Case Else : VBScriptingElse_
VBScriptingElse can be empty.
End Select
Do . . . Loop
This construction is useful when you do not know at programming time how many times the loop
will be executed. Here are some examples:
Do
AnyVBSCalculation
Loop Until D > Pi
Do Until Z < Y
AnyVBSCalculation
Loop
Do
AnyVBSCalculation
Содержание 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 ...