home *** CD-ROM | disk | FTP | other *** search
- Documentation for
- SETERR.EXE ver 1.1
- by Duane Paulson
-
- A batch file enhancer for those who occasionally run one batch file out of
- another batch file.
-
- SETERR sets the DOS errorlevel to any value between 0 and 255.
-
- Examples:
-
- seterr 0<cr> Sets the DOS errorlevel to 0.
-
- seterr 10<cr> Sets the DOS errorlevel to 10.
-
- seterr 255<cr> Sets the DOS errorlevel 10 255.
-
- Negative numbers are not allowed, and will be converted to positive numbers.
-
- Suggestions for use:
-
- Use with a batch file called by another batch file to return an errorlevel
- to the first batch file for conditional processing.
-
- ---------
- Version 1.1 corrects a bug where seterr would try to set errorlevels between
- 260 and 299. Since DOS function 4Ch only recognizes errorlevels up to 255,
- this resulted in an improper errorlevel being set. I also cleaned up the
- code considerably.
-
- ---------
- You can verify that the proper errorlevel has been set by the following
- process: From the DOS command line, type:
-
- if errorlevel <n> if not errorlevel <n+1> echo True<cr>
-
- Where <n> is replaced by the errorlevel you have set, and <n+1> is the next
- higher number. For example,
-
- seterr 55<cr>
- if errorlevel 55 if not errorlevel 56 echo True<cr>
-
- will only print "True" to the screen if the errorlevel is 55. With any other
- errorlevel, "True" will not be printed.