O
PERATOR
’
S
M
ANUAL
In the following fi
value outside the
o +32767. It takes extra time to guard against this, but unless you are sure that it
will not happen, you need some ki
the all
range
fixed or temporar
gure is a type of error message that you may see if one of your calculations has tried to set a
range -32768 t
nd of check. In the example on the next page, the red trace has gone outside
at the beginning, resulting in the message at the bottom of the instrument screen: This array is
ily locked:
OutResult.DataArray
.
owed
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
ensure that they do not.
possibilities at all points in your program, and you must either be certain that errors will not occur, or you must
take action to
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.
elong to a
For example, you may write some kind of generator of pseudo-random statistical values. If these b
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.
WRXi-OM-E Rev C
203