FDOS / freecom

FreeDOS Command Shell (command.com)
http://www.freedos.org/
GNU General Public License v2.0
158 stars 38 forks source link

`if errorlevel` statement doesn't work on FreeCOM 0.85 #54

Closed aimoff closed 3 years ago

aimoff commented 3 years ago

I'm using following statements in AUTOEXEC.BAT on FreeDOS. It works as expected with FreeCOM 0.84-pre7, but does not work with FreeCOM 0.85. It always falls to CHOICEA.

vframe /x14 /y8 /h11 /w52 /fBlack /bGray Single Shadow
vecho
vecho /fBlue "  Which driver do you want to use?"
vline hidden
vecho "  A: CHOICEA"
vecho "  B: CHOICEB"
vecho "  C: CHOICEC"
vecho "  D: CHOICED"
vecho "  No driver to load for now."
vchoice /fLightGreen /bBlack /t10 /d1
set choice=%errorlevel%
vgotoxy eot
verrlvl %choice%
set choice=
if errorlevel 5 goto COMMON
if errorlevel 4 goto CHOICED
if errorlevel 3 goto CHOICEC
if errorlevel 2 goto CHOICEB

:CHOICEA
loadhigh DriverA
goto COMMON
...

I tried to remove additional statements between vchoice command and if statement, but the result was same.

PerditionC commented 3 years ago

Thank you for the bug report. This has been fixed, please try the current snapshot release https://github.com/FDOS/freecom/suites/3023765298/artifacts/68595880 I am working on releasing a 0.85a update with this fix and some documentation improvements

PerditionC commented 3 years ago

see also https://sourceforge.net/p/freedos/bugs/310/

aimoff commented 3 years ago

Thanks. Version 0.85a works fine for me.