I would like to exit a Forth program (using Gforth 0.7.3) with a non-zero exit status.
I've tried:
1 bye
But the 1 is not interpreted as an argument to bye
(and I didn't expect this to work anyway; I couldn't find any hint in the documentation that bye
would accept an argument).
Note that I do not want to trigger an exception, as that also prints an error message (unless there is a way to suppress the error message of the exception from within the Forth program itself).
So, how do I exit a Forth program back to the hosted environment/OS providing a non-zero exit status?
(Basically, I'm looking for the equivalent of return EXIT_FAILURE; // from main()
(C) or exit(EXIT_FAILURE);
(C) or System.exit(1);
(Java).)