AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YDAT | YWAIT | Byzgraf | FAQs
exit grammar
 
A directive that performs low level cleanup (e.g., flushing output files) and then terminates the current process. If an expression is provided to exit, it is evaluated and the low order eight bits of the result are made available to the parent process of the Java virtual machine. There is no return from exit, even if it is called improperly. When exit is called from within the context of an execute call, it behaves as a return from execute.

Your main thread handles command line options and input files, and when there is nothing left to do the interpreter checks VM.exitmodel before deciding what should happen. VM.exitmodel should be one of:
0 indicating nothing special happens when the main thread quits, so your program must always call exit explicitly to quit.
1 indicating that the interpreter should do its best to guess if it should call exit when the main thread quits. The guess currently looks for active threads or visible windows before deciding what to do. This behavior currently is the default.
2 indicating that the interpreter should always exit when the main thread quits.
The usage description for exit can be summarized as follows:

Statement:
	exit ExpressionOPT ;
 
 Example:   The program,
import yoix.stdio.*;

printf("Nothing left to do\n");
behaves the way you would expect, but set exitmodel to 0 as below:
import yoix.stdio.*;

VM.exitmodel = 0;
printf("Nothing left to do\n");
exit(0);
and the explicit exit call is now required.
 
 See Also:   reference, return

 

Yoix is a registered trademark of AT&T Intellectual Property.