Home News DOC Class DL Others Rice
DOC  >  Exit point of execution
Exit point of execution

exit point

Execution of the Cooker program begins with calling and executing the start() method. And the called start() method will end sometime.

Is the end of the start() method the end of program execution?

In Cooker, the answer to this question is No. For example, an event handler assigned by the start() method may be waiting for an event to occur. The timer handler may be repeating the method call.

End of program execution in the Cooker is to replace the interpreter.

The .cook file is reloaded and a new interpreter is created for execution the new program. And the old interpreter is replaced to the new interpreter.

This is the end of program execution for the old interpreter and called the exit point of execution.

open method void end()

It may be necessary to clean up the old interpreter at the exit point of execution. For example, canceling the assignment of handlers, etc.

For the clean up, the Cooker attempts to call the end() method just before the interpreter is replaced.

However, since the definition of the end() method is optional, it will be called if the end() method is present, otherwise it will do nothing. This is different from the start() method.

The outline of the end() method definition is shown below.


open method void end()


// Method definition.



As shown above, end() is an open method with the name "end" with no arguments and no return value.

Even if there is a return value, it is meaningless because it is ignored.

Copyright © Rice All rights reserved.