
Writing Technician Interface Scripts
2-12
308660-14.00 Rev 00
if
The
if
command allows you to evaluate whether an expression is true. The
expression can be a comparison of two numerical values or two ASCII strings. If
the expression is true, the script interpreter executes any additional commands that
are on the same command line as the
if
command. If the expression is false, the
script interpreter does not execute the
if
command.
You use a semicolon (;) to end an
if
command. The semicolon separates the
if
command from the additional commands you want executed if the
if
command is
true.
Syntax
The
if
command has the following syntax:
if
[
<option>
]
<string1>
<operand>
<string2>
then;
<command>
[
;
<command>
...]
<option>
is one of the following arguments:
-u
tests whether
<string1>
is an unsigned number.
-num
tests whether
<string1>
is a number.
-ip
tests whether
<string1>
is an IP address.
-ipx
tests whether
<string1>
is an IPX address.
-ic
means ignore case when comparing strings.
-file
tests whether
<filename>
is present.
-dir
tests whether
<directory_name>
is present.
-vines
tests whether
<string1>
is a VINES address.
-date
tests whether
<string1>
uses the date format MM/DD/YY.
-time
tests whether
<string1>
uses the time format HH:MM:SS.
-tz
tests whether
<string1>
uses the GMT offset format [+ | -]HH:MM.
Commenti su questo manuale