home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / VIRUS / DLCHK12.ZIP / SETERR.DOC < prev    next >
Encoding:
Text File  |  1991-03-18  |  1.4 KB  |  45 lines

  1.                  Documentation for
  2.                  SETERR.EXE ver 1.1
  3.                  by Duane Paulson
  4.  
  5. A batch file enhancer for those who occasionally run one batch file out of
  6. another batch file.
  7.  
  8. SETERR sets the DOS errorlevel to any value between 0 and 255.
  9.  
  10. Examples:
  11.  
  12.     seterr 0<cr>        Sets the DOS errorlevel to 0.
  13.  
  14.     seterr 10<cr>        Sets the DOS errorlevel to 10.
  15.  
  16.     seterr 255<cr>      Sets the DOS errorlevel 10 255.
  17.  
  18. Negative numbers are not allowed, and will be converted to positive numbers.
  19.  
  20. Suggestions for use:
  21.  
  22. Use with a batch file called by another batch file to return an errorlevel
  23. to the first batch file for conditional processing.
  24.  
  25. ---------
  26. Version 1.1 corrects a bug where seterr would try to set errorlevels between
  27. 260 and 299. Since DOS function 4Ch only recognizes errorlevels up to 255,
  28. this resulted in an improper errorlevel being set. I also cleaned up the
  29. code considerably.
  30.  
  31. ---------
  32. You can verify that the proper errorlevel has been set by the following
  33. process: From the DOS command line, type:
  34.  
  35.     if errorlevel <n> if not errorlevel <n+1> echo True<cr>
  36.  
  37. Where <n> is replaced by the errorlevel you have set, and <n+1> is the next
  38. higher number. For example,
  39.  
  40.     seterr 55<cr>
  41.     if errorlevel 55 if not errorlevel 56 echo True<cr>
  42.  
  43. will only print "True" to the screen if the errorlevel is 55. With any other
  44. errorlevel, "True" will not be printed.
  45.