beautypg.com

Teledyne LeCroy WaveRunner XI SERIES Operator’s Manual User Manual

Page 195

background image

O

PERATOR

S

M

ANUAL

WRXi-OM-E Rev C

195

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

ry complex constructions using If, as in the examples below:

Else_

Z = 31

End If

Else_

If A > 3 Then

Z = 63

Else

Z = 127

End If

End If

If A > 0 Then

If B > 0 Then

Z = Y

End If

End If

This is equivalent to:

Z = Y

(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:

If A >= 0 Then

B = Sqr (A)

Else

B = 0

End If

and in fact you can make some ve

If A < 0 Then

If A < - 1 Then

Z = 17

If ( (A > 0) And (B > 0) ) Then