exit_program (return_value)
Terminate the interpreter immediately and return the provided integer value to the operating system as an exit code.
Running this program...
#!/usr/cogent/bin/gamma
//Program: exiting.g
atexit(#princ("Exiting now.\n"));
princ("Started running...\n");
princ("Still running.\n");
exit_program(7);
princ("You missed this part.\n");
...gives these results:
[]$ gamma exiting.g Started running... Still running. Exiting now. []$
Exit showing abnormal termination of -1 (255) to the operating system. exit_program(-1); />echo $? 255 />
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.