home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
sysutl
/
err_ret.arc
/
ERR_RET.DOC
< prev
next >
Wrap
Text File
|
1989-09-21
|
2KB
|
46 lines
ERR_RET, last modified 9/20/89.
There have been many times that I wanted to know what error
level a program returned when it terminated. The only way that I am
aware of to determine this is to set up a series of tests within a
batch file. This can be very cumbersome, especially if any of the 255
possible values might be returned. I have never seen a utility that
will run another program and report the returned error level. This is
a shame as there are many utilities that use this facility to report
system parameters or errors and a simple way to test them is needed.
Some of the programs I am writing are designed to be called by another
program and to return some status information via the error level. This
kind of utility would be very handy for testing and debugging. I
therefore wrote this short program that does just that task.
To use it, at the DOS prompt, type ERR_RET and the command
line parameters that you were planning to use. For example, if you
were going to type:
MYPROG -C -X INFILE.DAT
you would type:
ERR_RET MYPROG -C -X INFILE.DAT.
Your program will be run as it would have normally been and a message
will be issued at the end with the returned error level.
If you run ERR_RET without any other parameters, you will get
a short message with the correct syntax. If there is not enough memory
or ERR_RET cannot find your program in the current directory or DOS PATH,
you will get an appropriate error message.
ERR_RET was compiled with Turbo C, Version 2.0. It may be freely
copied, modified, used, etc. If you distribute it, please keep the 3 files
together. Please do not modify this documentation and be sure to mark very
clearly any modifications that you have added.
Comments may be sent to:
Steven Fischkoff, M.D.
CompuServe: 76367,307
GEnie: EOSINOPHIL
Prodigy: SVBC97A