MSX-DOS2 batch scripting: error codes

Por sd_snatcher

Prophet (3505)

imagem de sd_snatcher

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?

Entrar ou registrar-se para comentar

Por Manuel

Ascended (18776)

imagem de Manuel

17-01-2016, 17:07

A very good question!

Por SuchAGoonie

Expert (108)

imagem de SuchAGoonie

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.)

Por Manuel

Ascended (18776)

imagem de Manuel

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)

Por sd_snatcher

Prophet (3505)

imagem de sd_snatcher

18-01-2016, 22:05

Thanks for the help! Smile