Summary Of Select Case - LeCroy WaveMaster 8600A Operator's Manual

X-stream oscilloscopes
Table of Contents

Advertisement

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.
This is very 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. File for this example: SelectCase.Xls
Summary of Select Case . . . . End Select
SelectCase VariableName
Case Alist : VBScriptingA
Case Blist : VBScriptingB
. . . .
Case Else : VBScriptingElse_
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
296
VBScriptingElse can be empty.
WM-OM-E Rev I

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents