MSX-DOS2 batch scripting: error codes

By sd_snatcher

Prophet (3092)

sd_snatcher's picture

17-01-2016, 16:22

On MS-DOS, the programmer can check if the previous command has exit with error by checking the %ERRORLEVEL% variable. How this can be done on MSX-DOS2/Nextor?

Login or register to post comments

By Manuel

Ascended (15821)

Manuel's picture

17-01-2016, 17:07

A very good question!

By SuchAGoonie

Expert (108)

SuchAGoonie's picture

17-01-2016, 17:13

If you use TNI's COMMAND2.COM, you can create .BTM files that have extended functionality. There's also support for error codes. This is a snippet from the ENV.HLP help file:

_ERROR: This  is the error code of the previous command. See
the  "Program Interface Specification" for a list of all the
currently defined  error codes  and the  messages for  them.
(For   example  "215"   for  "File  not  found",  "142"  for
"Unrecognized command", "0" for no error.)

By Manuel

Ascended (15821)

Manuel's picture

17-01-2016, 17:24

This is what BiFi told me about it:

BiFi: in 2.4x there's the _ERROR internal variable
BiFi: before that there's no support for that
BiFi: see ENV.HLP (or HELP ENV on the command line)

By sd_snatcher

Prophet (3092)

sd_snatcher's picture

18-01-2016, 22:05

Thanks for the help! Smile