256
SDA-OM-E Rev H
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:
If A >= 0 Then
B = Sqr (A)
Else
B = 0
End If
and in fact you can make some very complex constructions using If, as in the examples below:
If A < 0 Then
If A < - 1 Then
Содержание SDA
Страница 1: ...SERIAL DATA ANALYZER OPERATOR S MANUAL December 2007 ...
Страница 148: ...Standard Horizontal Parameter Help Markers Standard Vertical Parameter Help Markers 148 SDA OM E Rev H ...
Страница 223: ...SDA Operator s Manual Example 6 SDA OM E Rev H 223 ...
Страница 225: ...SDA Operator s Manual SDA OM E Rev H 225 ...
Страница 232: ...In this figure the panel has been pasted onto the Excel sheet for comparison 232 SDA OM E Rev H ...
Страница 243: ...SDA Operator s Manual This example used the CORREL Array1 Array2 function of Excel as depicted below SDA OM E Rev H 243 ...
Страница 246: ...246 SDA OM E Rev H ...
Страница 247: ...SDA Operator s Manual Excel Example 5 Using a Surface Plot SDA OM E Rev H 247 ...
Страница 279: ...SDA Operator s Manual Convolving two signals SDA OM E Rev H 279 ...
Страница 310: ...The jitter wizard is accessed from the Analysis drop down menu 310 SDA OM E Rev H ...
Страница 327: ...SDA Operator s Manual SDA OM E Rev H 327 ...
Страница 328: ...328 SDA OM E Rev H ...
Страница 394: ...394 SDA OM E Rev H ...
Страница 395: ...SDA Operator s Manual SDA OM E Rev H 395 ...