Return codes

BlitzMax Forums/BlitzMax Programming/Return codes

Muttley(Posted 2010) [#1]
Anyone know if it's possible to specify a return code that a Max program will use when it exits?

I could really do with this as I'm calling some executables from a Perl script and want to be able to detect errors without scraping STDOUT for error messages.

Cheers

Muttley


Brucey(Posted 2010) [#2]
Not currently.

But I've just knocked together a tweak to brl.appstub which let's me do this on Mac :
SuperStrict

ExitCode = 4


$ ./untitled1.debug
$ echo $?
4


which is kind of what you want.


Tommo(Posted 2010) [#3]
You can use
 exit_(exitcode%) 
to return a exit code.


Muttley(Posted 2010) [#4]
Thanks all,

I'll use Tommo's solution as no core module changes are required. :)

Muttley