![LeCroy WaveRunner 104MXI Operator'S Manual Download Page 203](http://html1.mh-extra.com/html/lecroy/waverunner-104mxi/waverunner-104mxi_operators-manual_1866369203.webp)
O
PERATOR
’
S
M
ANUAL
WRXi-OM-E Rev B
203
In the following figure is a type of error message that you may see if one of your calculations has tried to set a
value outside the range -32768 to +32767. It takes extra time to guard against this, but unless you are sure that it
will not happen, you need some kind of check. In the example on the next page, the red trace has gone outside
the allowed range at the beginning, resulting in the message at the bottom of the instrument screen: This array is
fixed or temporarily locked:
OutResult.DataArray
.
Error Handling
Note that the construction OnError GoTo Label: is not allowed in VBS. In fact no GoTos or labels are allowed.
Therefore there is no way for you to provide handlers to deal with errors and exceptions. You must be aware of all
possibilities at all points in your program, and you must either be certain that errors will not occur, or you must
take action to ensure that they do not.
Examples:
Sqr
You cannot take the square root of a negative
number.
Log
You cannot take the log of zero or of a negative
number.
A / B
You cannot divide by zero.
Array
You cannot use an index outside the bounds of an
array.
Size
Unscaled data cannot go outside the range -32768
to 32767.
If there is any possibility that any of these might occur, take steps to deal with this before it can happen.
For example, you may write some kind of generator of pseudo-random statistical values. If these belong to a
distribution that in principle has an infinite range, or a finite range which is wider than the signed 16-bits allowed,
check each value. If a value falls outside the range, you could set it to the maximum or generate another
example.