Teledyne LeCroy WaveExpert 100H Operators Manual User Manual

Page 280

Advertising
background image

Operator’s Manual

278

WE-OM-E Rev A

End If

If . . . Then . . . End If__

If . . . Then . . . Else . . . End If

Select Case

. . . .

End Select

While

. . . .

Wend

Choose the construction that best satisfies the requirements of speed and clarity.

The construction GoTo LabelledStatement is available in many languages, including VBA, but not
in VBS.

GOTO

is not allowed in VBS.

IF . . . Then . . . Else . . . End If

A very simple example:

If A >= 0 Then B = Sqr (A) 'Take the square root of A if A is not negative.

If A + B < C + D Then E = F : G = H_ 'No End Is needed if all on one
line.

If you need to perform a longer procedure, make this construction:

If A >= 0 Then

B = Sqr (A)

C = 32766 * Sin ( TwoPi * B / PeriodOfSinusoid)

End If ' End If is needed to terminate the construction.

The If statement is very often used with the following Boolean expressions:

A > B A is greater than B

A >= B A is greater than B or equal to B

A = B A is equal to B

A < B A is less than B

A <= B A is less than B or equal to B

A <> B A is not equal to B

These statements are not like the usual program statements, such as A = B. These statements are
Boolean (logic) statements, which can take the values True or False. You may even see things like
"If A Then B", which means that if A is True, B gets done.

In the first example, if A is negative, we might want to write something like this:

Advertising