beautypg.com

Teledyne LeCroy WaveExpert 100H Operators Manual User Manual

Page 283

background image

Wave Expert

WE-OM-E Rev A

281

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_

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