Return Status Code

BlitzMax Forums/BlitzMax Programming/Return Status Code

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.

Might be worth showing some code you have already. Would OnEnd help?

You mean a errorlevel value?
Read here: http://www.blitzmax.com/Community/posts.php?topic=45917#510535

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..