home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / timevent / taskmstr / cond_01.tsk next >
Encoding:
Text File  |  1995-05-07  |  2.2 KB  |  91 lines

  1. ///////////////////////////////////////////////////////////////////////
  2. //
  3. // Examples of how to utilize IF/ELSEIF/ELSE/ENDIF.
  4. //
  5. ///////////////////////////////////////////////////////////////////////
  6.  
  7.  
  8. ///////////////////////////////////////////////////////////////////////
  9. //  IF/ENDIF combination                          (supports NOT/AND/OR)
  10.  
  11. //  The IF/ENDIF combination
  12.     IF EXIST *.BAK
  13.       ECHO  *.BAK found!
  14.     ENDIF
  15.  
  16.  
  17. //  using the NOT operator
  18.     IF NOT EXIST *.BAK
  19.       ECHO  *.BAK not found!
  20.     ENDIF
  21.  
  22.  
  23. //  using the OR operator
  24.     IF EXIST *.BAK OR EXIST *.TMP
  25.       ECHO  Either *.BAK or *.TMP found!
  26.     ENDIF
  27.  
  28.  
  29. //  using the NOT and OR operator
  30.     IF NOT EXIST *.BAK OR EXIST *.TMP
  31.       ECHO  Either *.BAK not found or *.TMP found!
  32.     ENDIF
  33.  
  34.  
  35. //  using the AND operator
  36.     IF EXIST *.BAK AND EXIST *.TMP
  37.       ECHO  Both *.BAK and *.TMP found!
  38.     ENDIF
  39.  
  40.  
  41. //  using the NOT and AND operator
  42.     IF NOT EXIST *.BAK AND EXIST *.TMP
  43.       ECHO  Both *.BAK not found and *.TMP found!
  44.     ENDIF
  45.  
  46.  
  47. ///////////////////////////////////////////////////////////////////////
  48. //  IF/ELSE/ENDIF combination                     (supports NOT/AND/OR)
  49.  
  50.     IF EXIST *.BAK
  51.       ECHO  *.BAK found!
  52.     ELSE
  53.       ECHO  *.BAK not found!
  54.     ENDIF
  55.  
  56.  
  57. ///////////////////////////////////////////////////////////////////////
  58. //  IF/ELSEIF/ELSE/ENDIF combination              (supports NOT/AND/OR)
  59.  
  60.     IF EXIST *.BAK
  61.       ECHO *.BAK found!
  62.     ELSEIF EXIST *.TMP
  63.       ECHO *.BAK not found and *.TMP found!
  64.     ELSEIF EXIST *.TXT
  65.       ECHO Neither *.BAK nor *.TMP found but *.TXT was found!
  66.     ELSE
  67.       ECHO *.BAK, *.TMP, and *.TXT not found!
  68.     ENDIF
  69.  
  70.  
  71. ///////////////////////////////////////////////////////////////////////
  72. //  IF/GOTO combination                           (supports NOT/AND/OR)
  73.  
  74.     IF EXIST *.BAK GOTO :FOUND
  75.  
  76. :NOTFOUND
  77.     ECHO  *.BAK not found!
  78.     GOTO :END
  79.  
  80. :FOUND
  81.     ECHO  *.BAK found!
  82.  
  83. :END
  84.  
  85.  
  86. ///////////////////////////////////////////////////////////////////////
  87. //  IF/THEN combination                           (supports NOT/AND/OR)
  88.  
  89.     IF EXIST *.BAK THEN ECHO *.BAK found!
  90.  
  91.