@echo off
rem This batch-file demonstrates the usage of errorlevels (=exitcodes) in
rem MicroBASIC-programs. When you have executed a MicroBASIC program from
rem within a batch-file, you can check the errorlevel with the batch-command
rem IF ERRORLEVEL ? GOTO Label

exitcode.com
IF ERRORLEVEL 5 GOTO Five
IF ERRORLEVEL 4 GOTO Four
IF ERRORLEVEL 3 GOTO Three
IF ERRORLEVEL 2 GOTO Two
IF ERRORLEVEL 1 GOTO One
IF ERRORLEVEL 0 GOTO Escape

:Five
ECHO Batch-file message: ERRORLEVEL=5
GOTO Einde

:Four
ECHO Batch-file message: ERRORLEVEL=4
GOTO Einde

:Three
ECHO Batch-file message: ERRORLEVEL=3
GOTO Einde

:Two
ECHO Batch-file message: ERRORLEVEL=2
GOTO Einde

:One
ECHO Batch-file message: ERRORLEVEL=1
GOTO Einde

:Escape
ECHO Batch-file message: ERRORLEVEL=0 (Escape pressed)
GOTO Einde

:Einde
ECHO Batch-file message: End of batch-file
