Scripting With Vbscript; Variable Types; Variable Names - LeCroy WaveRunner Xi series Operator's Manual

Oscilloscopes
Hide thumbs Also See for WaveRunner Xi series:
Table of Contents

Advertisement

Scripting with VBScript

S
EPARATORS
The two separators in VBS are the colon : and the single quotation mark .
Using the colon, you can place two or more statements on a line, for example:
XMin = 0.0 : XMax = 800.0 : YMin = 0.0 : YMax = 600.0
There is also an implied separator whenever a new line is begun.
Using the quotation mark you can signify that the remainder of the line is a comment: non-executable material
that is usually used to clarify the workings of the script. For example:
RMSMax = 32767 / Sqr (2)
' fitted into the screen in unscaled mode.
To continue a comment on to another line, another quotation mark is required on the new line.

Variable Types

VBS supports the following variable types:
Integer
Long
Single
Double
Boolean
String
When making comparisons using real numbers, beware of testing for equality, because of rounding errors. It may
be better to apply a tolerance band. For Boolean, integers and strings, equality is valid.
You can use variables in VBS withou
example, if the result of a calculation is of a different type from the defined type,
set out calculations in such a way that type changes will not affect the final resul
unpredictable way. If you want to change the type of a va
show others what you intend to happen. T
Variable Na
mes
Upper and lower case have no s
by the system), but it is a good idea to
least 36 characters may be used in a v
numeric characters, and the underscore chara
name.
Do not use any of the following
! @ & $ # ? , * . { } ( ) [ ] = + - ^ % / ~ < > : ;
Just use al
phanumerics and underscore, for example: Example_Name
If you have to introduce constants, give them sensible names, just like varia
_If RMS < 23169 Then OutputY = Y
Its meaning may not be obvious to someone else.
It is better to write something like this:
FullScale = 32767
RootTwo = Sqr (2.0)
WRXi-OM-E Rev C
' RMS of the largest sinusoid that can be
signed 16 bit value in the range -32768 to 32767
signed 32 bit value in the range -2
real number or floating point number
real number or floating point number
Boolean or logical value
string of characters
t declaring the type. The context may force an implicit type assignment. For
he conversion functions are CDbl, CInt, CLng, CSng, CStr.
ignificance in VBS, either in variable names or in keywords (the names reserved
be consistent about the spelling of a variable name to avoid confusion. At
ariable name. These can include any combination of alphabetic and
cter. No other punctuation character may be used in a variable
char
acters in a variable name:
31
31
to +2
- 1
the type may be changed. Always
t in an undesirable or
riable or a result, use a conversion function that will
bles. For example, do not write:
O
'
M
PERATOR
S
ANUAL
191

Advertisement

Table of Contents
loading

Table of Contents