Error Handling and Messages from the BCX Translator

The BCX translator returns a 1 when a successful translation has been completed. If a problem has occured during translation and BCX aborts, 0 is returned. This return value can be determined by a batch file and a conditional jump can be made based on whether or not the compilation was successful. Here is a sample LCALL.BAT the jumps to an error message if 0 is returned.


 @ECHO OFF
 IF NOT EXIST %1.bas GOTO usage
 C:\dev\BCX\bin\bc.exe %1
 IF errorlevel = 0 GOTO errormsg
 C:\dev\PellesC\bin\pocc -W1 -Gd -Go -Ze -Zx -Tx86-coff %1.c
 C:\dev\PellesC\bin\polink -release -machine:ix86 -subsystem:console -OUT:%1.exe %1.obj %2 %3
 ECHO Finished!
 GOTO done
 :errormsg
 echo translation aborted
 GOTO done
 :usage
 ECHO **************************************************************
 ECHO  Usage:  PCALL.BAT MainFile  ExtraFile1 ExtraFile2 ExtraFile3
 ECHO  Note:   ExtraFiles can be .libs, .res , .obj
 ECHO  Use this batch file to create console mode program
 ECHO **************************************************************
 :done