QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: doppler on August 22, 2020, 06:56:24 am
-
It's possible for me to detect a critical error while running my QB64 program (finding corrupted data sets). I would like to set %ERRORLEVEL% so the bat/cmd script I call my program can exit and not continue. It's a real pain to detect the error and manually terminate the script command terminal before I exit the qb64 program. Programs like WGET can set error levels so your calling script can do other things based on the code number.
I figure something like "_system=4" would exit with code 4 set in %ERRORLEVEL%. Unfortunately %ERRORLEVEL% would need to be set to 0 on any exit path. (system or end)
-
Use SYSTEM to return an exit code:
-
Nuisances, will get you every time. You are most a where how much it is a hassle to have multiple languages swimming around in your head. And I am not talking about the talking kind.
Thanks for the pointer.