![LeCroy WaveRunner 104MXI Operator'S Manual Download Page 192](http://html1.mh-extra.com/html/lecroy/waverunner-104mxi/waverunner-104mxi_operators-manual_1866369192.webp)
W
AVE
R
UNNER
X
I
S
ERIES
192
WRXi-OM-E Rev B
MaxRMS = FullScale / RootTwo
. . . . .
If RMS < MaxRMS Then . . . . .
But to keep your scripts fast, leave definitions like this outside your loops.
General usage
Note that white space has no effect, so you can introduce spaces for clarity, except of course within variable
names, function names and other keywords. Indenting control statements can be a great help in understanding a
program. For example:
For K = Kstart To Kstop
X = K * Sqr (3)
For N = NStart To Nstop
Y = N * N
If Y < FullScale Then
. . . . . .
. . . . . .
End If ' End of main calculation
Next ' End of N loop
Next ' End of K loop
If a section becomes very long, you could provide the end with a comment, to show where it comes from.
Arithmetic Operators
As with most other languages, the arithmetic operators are used as follows:
^
Exponentiation A ^ B = A
B
= A raised to the power
B
/
Division
A / B = A divided by B
\
Integer division A \ B = A divided by B, truncated to
next integer below
*
Multiplication
A * B = A multiplied by B
+
Addition
A + B = B added to A
-
Subtraction
A B = B subtracted from A
PLEASE NOTE THE FOLLOWING:
•
If there is any possibility that you will be taking the exponent of a negative number, make sure to trap any
possible errors arising from such operations as trying to take the square root of a negative number. Logs of
negative numbers are forbidden also.
•
If there is any possibility that you will be dividing by zero, make sure to trap this.
•
There are two ways of dealing with these types of problem. One is to prevent it happening by making
suitable tests before the calculation is performed. The other is to let it happen, and use an error handling
routine. This will be discussed later.
•
Normally in VBScript you will know the range of the data, since all the incoming data are, by definition,
integer (unscaled data) or real (scaled data), and they must fit into the screen of the instrument.