Jump to content

DOS programming -> ERRORLEVEL issues


before
 Share

Recommended Posts

I've got something that looks like this:

CHOICE /C:123456789 /M Choice: 
IF ERRORLEVEL 1 GOTO universal
IF ERRORLEVEL 2 GOTO 2006remade
IF ERRORLEVEL 3 GOTO allstarlegends
IF ERRORLEVEL 4 GOTO creativescape
IF ERRORLEVEL 5 GOTO crisisx
IF ERRORLEVEL 6 GOTO firepk
IF ERRORLEVEL 7 GOTO ohhaider
IF ERRORLEVEL 8 GOTO pkhonor
IF ERRORLEVEL 9 GOTO runedeath

...It works perfectly. But how can I go above 9? This: (below) doesn't work.

CHOICE /C:123456789ab /M Choice: 
IF ERRORLEVEL 1 GOTO universal
IF ERRORLEVEL 2 GOTO 2006remade
IF ERRORLEVEL 3 GOTO allstarlegends
IF ERRORLEVEL 4 GOTO creativescape
IF ERRORLEVEL 5 GOTO crisisx
IF ERRORLEVEL 6 GOTO firepk
IF ERRORLEVEL 7 GOTO ohhaider
IF ERRORLEVEL 8 GOTO pkhonor
IF ERRORLEVEL 9 GOTO runedeath
IF ERRORLEVEL 10 GOTO vasora
IF ERRORLEVEL 11 GOTO runeonline

Help please, I know ERRORLEVELs can go up to level 255 but I can't get it to work in the 'choice' part!@$@$^@$^!#%@#&%%)

Link to comment
Share on other sites

CHOICE /C:123456789ab /M Choice:

IF ERRORLEVEL 11 GOTO runeonline 

IF ERRORLEVEL 10 GOTO vasora

IF ERRORLEVEL 9 GOTO runedeath

IF ERRORLEVEL 8 GOTO pkhonor

IF ERRORLEVEL 7 GOTO ohhaider

IF ERRORLEVEL 6 GOTO firepk

IF ERRORLEVEL 5 GOTO crisisx

IF ERRORLEVEL 4 GOTO creativescape

IF ERRORLEVEL 3 GOTO allstarlegends

IF ERRORLEVEL 2 GOTO 2006remade

IF ERRORLEVEL 1 GOTO universal

the if command matches for equal or higher, so the checks need to be made in reverse order

 

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...