
WR6K-OM-E Rev A
ISSUED: October 2003
275
If A > 6 Then VBScripting3
If A > 4 Then VBScripting4
If A > 3 Then VBScripting5
If A > 1 Then VBScripting6
Be very careful when testing for equality. There will be no trouble with Integers, Long Integers,
and Strings, but Real numbers are different. Because they have so many significant digits, values
that should be equal, may differ minutely after a computation. It is safer with Real numbers to test
using a tolerance band.
File for this example: IfThenElse.xls
If you find that you are building up a rather complicated set of Ifs, you might want to consider the
Select Case construction.
Select Case
This is a very powerful construction, which is also easy to understand when written out. It is best
for Integers and Strings, where exact values are always obtained. Here is a simple example:
Select Case K
Case 7 : Y = 6 : Z = 3
Case 7 : Y = Sqr (Sin (A) ) : Z = Sqr (Cos (A) )
Case N : Z = Y + X
Case Else :
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.
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.
Содержание 6000 SERIES
Страница 59: ...WR6K OM E Rev A ISSUED October 2003 57 4 Select a language 5 Click Next when the Wizard appears ...
Страница 60: ...Operator s Manual 58 ISSUED October 2003 WR6K OM E Rev A 6 Select Complete setup 7 Click Install ...
Страница 65: ...WR6K OM E Rev A ISSUED October 2003 63 Proper Orientation of Drive ...
Страница 131: ...WR6K OM E Rev A ISSUED October 2003 129 Example ...
Страница 141: ...WR6K OM E Rev A ISSUED October 2003 139 ...
Страница 236: ...Operator s Manual 234 ISSUED October 2003 WR6K OM E Rev A Example 6 ...
Страница 247: ...WR6K OM E Rev A ISSUED October 2003 245 In this figure the panel has been pasted onto the Excel sheet for comparison ...
Страница 261: ...WR6K OM E Rev A ISSUED October 2003 259 ...
Страница 286: ...Operator s Manual 284 ISSUED October 2003 WR6K OM E Rev A ...
Страница 304: ...Operator s Manual 302 ISSUED October 2003 WR6K OM E Rev A ...
Страница 307: ...WR6K OM E Rev A ISSUED October 2003 305 Convolve two signals ...
Страница 327: ...WR6K OM E Rev A ISSUED October 2003 325 How JitterTrack s Interval Error works when Clock Mode is selected ...
Страница 348: ...Operator s Manual 346 ISSUED October 2003 WR6K OM E Rev A ...
Страница 398: ...Operator s Manual 396 ISSUED October 2003 WR6K OM E Rev A Setting Up the Line Voltage and Current Signals ...
Страница 402: ...Operator s Manual 400 ISSUED October 2003 WR6K OM E Rev A ...