Return Status Code

BlitzMax Forums/BlitzMax Programming/Return Status Code

pha3z(Posted 2008) [#1]
Is there any way to return a specified status code from blitzbasic? It seems that "End", "RuntimeError", and "Return <val>" always return 1 as their ending status code.

I seriously need some control over this to use blitzbasic for commandline tools in a pipeline.


tonyg(Posted 2008) [#2]
Might be worth showing some code you have already. Would OnEnd help?


ziggy(Posted 2008) [#3]
You mean a errorlevel value?
Read here: http://www.blitzmax.com/Community/posts.php?topic=45917#510535


plash(Posted 2008) [#4]
Mark said,
"The C function 'exit_' should do the trick, eg: 'exit_ 1000'.

This will call the C atexit_ list (which is what OnEnd actually uses) so should perform a clean shutdown.

Perhaps I should add an optional parameter to 'End' as well?"

Why has this not been implemented yet? It sounds so simple..