beautypg.com

Summary of select case . . . . end select, Do . . . loop – Teledyne LeCroy WaveRunner XI SERIES Operator’s Manual User Manual

Page 197

background image

O

PERATOR

S

M

ANUAL

WRXi-OM-E Rev C

197

Case 7, 15, 31, 63, 127 : Z = Y + X

Case Else : Z = 3

End Select

Case N assumes that the value o

already

Else is included to cover other cases, whether

foreseen or not. It should always

ded.

This is very much neater than a st

Ifs and E

ber: you cannot use Select Case unless you are

sure of exact equality, which allows you to compa

ou cannot put Case > 5, for

example. File for this example: Select

: VBScriptingElse_

VBScriptingElse can be empty.

elect

ction is useful when you do not know at programming time how many times the loop will be executed.

Pi

Y

lation

<= Pi

>=Z

ation

structions enable you to make the test before or after the calculation. If before, the calculation might not

time, if the condition for terminating were already true. With the condition at the end, the

e at least one time.

ht want to exit the loop from somewhere inside: for example, if some kind of problem is

arithm of a negative number.

, you can use

If . . . . Then Exit Do.

pause of 10 seconds you can write:

+ 10.0

me

er is a clock function in the PC, which has a resolution of one second.

f N has

be inclu

been set. Case

ring of

lses, but remem

re integers and strings only. Y

Case.Xls

Summary of Select Case . . . . End Select

SelectCase VariableName

Case Alist : VBScriptingA

Case Blist : VBScriptingB

. . . .

Case Else

End S

Do . . . Loop

This constru
Here are some examples:

Do

AnyVBSCalculation

Loop Until D >

Do Until Z <

AnyVBSCalcu

Loop

Do

AnyVBSCalculation

Loop While D

Do While Y

AnyVBSCalcul

Loop

These con
be done even one
calculation is don

Sometimes you mig
looming, such as the log

For this case

To make a

NewTime = Timer

Do Loop Until Timer >= NewTi

where Tim