home *** CD-ROM | disk | FTP | other *** search
- ///////////////////////////////////////////////////////////////////////
- //
- // Examples of how to utilize IF/ELSEIF/ELSE/ENDIF.
- //
- ///////////////////////////////////////////////////////////////////////
-
-
- ///////////////////////////////////////////////////////////////////////
- // IF/ENDIF combination (supports NOT/AND/OR)
-
- // The IF/ENDIF combination
- IF EXIST *.BAK
- ECHO *.BAK found!
- ENDIF
-
-
- // using the NOT operator
- IF NOT EXIST *.BAK
- ECHO *.BAK not found!
- ENDIF
-
-
- // using the OR operator
- IF EXIST *.BAK OR EXIST *.TMP
- ECHO Either *.BAK or *.TMP found!
- ENDIF
-
-
- // using the NOT and OR operator
- IF NOT EXIST *.BAK OR EXIST *.TMP
- ECHO Either *.BAK not found or *.TMP found!
- ENDIF
-
-
- // using the AND operator
- IF EXIST *.BAK AND EXIST *.TMP
- ECHO Both *.BAK and *.TMP found!
- ENDIF
-
-
- // using the NOT and AND operator
- IF NOT EXIST *.BAK AND EXIST *.TMP
- ECHO Both *.BAK not found and *.TMP found!
- ENDIF
-
-
- ///////////////////////////////////////////////////////////////////////
- // IF/ELSE/ENDIF combination (supports NOT/AND/OR)
-
- IF EXIST *.BAK
- ECHO *.BAK found!
- ELSE
- ECHO *.BAK not found!
- ENDIF
-
-
- ///////////////////////////////////////////////////////////////////////
- // IF/ELSEIF/ELSE/ENDIF combination (supports NOT/AND/OR)
-
- IF EXIST *.BAK
- ECHO *.BAK found!
- ELSEIF EXIST *.TMP
- ECHO *.BAK not found and *.TMP found!
- ELSEIF EXIST *.TXT
- ECHO Neither *.BAK nor *.TMP found but *.TXT was found!
- ELSE
- ECHO *.BAK, *.TMP, and *.TXT not found!
- ENDIF
-
-
- ///////////////////////////////////////////////////////////////////////
- // IF/GOTO combination (supports NOT/AND/OR)
-
- IF EXIST *.BAK GOTO :FOUND
-
- :NOTFOUND
- ECHO *.BAK not found!
- GOTO :END
-
- :FOUND
- ECHO *.BAK found!
-
- :END
-
-
- ///////////////////////////////////////////////////////////////////////
- // IF/THEN combination (supports NOT/AND/OR)
-
- IF EXIST *.BAK THEN ECHO *.BAK found!
-