Format: IF [NOT] [WARN | ERROR | FAIL] (string) [EQ | GT |GE (string)] [VAL] {EXISTS (filename)] Template: NOT/S,WARN/S,ERROR/S,FAIL/S,EQ/K,GT/K,GE/K,VAL/S,EXISTS/K Location: Internal
in a script file, IF, when its conditional is true, carries out all the subsequent command until an ENDIF, however, ELSE, command is found. IF must be used in conjunction with ENDIF, however, ELSE is optional. When the conditional is not true, execution skips directly to the ENDIF or to an ELSE. The conditons and commands in IF and ELSE blocks can span more than one line begore their corresponding ENDIF's.
Nested if's jump to the matching ENDIF.
Keywords are as follows:
If the previous command produces a return code greater than or equal to 10, AmigaDOS skips over the ECHO command to the errlab lable.
Example: