Symbol PDT 3200 Technical Reference Manual page 109

Hide thumbs Also See for PDT 3200:
Table of Contents

Advertisement

Command
Type
Purpose
The IF subcommand 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 then the command is executed, otherwise the command is
bypassed and the next command in the batch Þle is executed. The [NOT] option
will test 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 will test
if 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 will create a condition that is true only when
the strings are not identical.
The EXIST condition is true if the speciÞed Þlename is found. Wildcard characters
are allowed in the Þlename. The [NOT] EXIST condition will be true if the Þlename
cannot be found.
Examples
IF ERRORLEVEL 15 GOTO :EXIT
This command will GOTO the :EXIT label if the ERRORLEVEL was equal to or
greater than 15.
IF
Internal Batch Subcommand
Chapter 5: ROM DOS Commands
5-57

Advertisement

Table of Contents
loading

Table of Contents