Avery Dennison 6035 Programmer Manual Rev.A 7/98 User Manual

Page 125

Advertising
background image

7/9/98

ROM-DOS 6.22 Command Descriptions 3-67

I F B a t c h S u b c o m m a n d

Internal

Purpose

Allows conditional execution of commands.

Syntax

IF [NOT]

condition command

Remarks

The condition may be any one of the following:

ERRORLEVEL number
string1
== string2

EXIST [d:][path]filename

If the condition is true, the command is executed; otherwise, the
command is bypassed and the next command in the batch file is
executed. The [NOT] option tests the opposite of any of the
conditions.

The ERRORLEVEL number is true if the last program to execute had
an exit code equal or greater than number. Using the [NOT] option
with this condition tests whether or not the exit code is less than the
number argument.

The condition string1 == string2 is only true when string1 and string2
are identical. The strings must match exactly; uppercase/lowercase
mismatches are not allowed. Applying the [NOT] option creates a
condition that is true only when the strings are not identical.

The EXIST condition is true if the specified filename is found.
Wildcard characters are allowed in the filename. The [NOT] EXIST
condition is true if the filename cannot be found.

Advertising