Entry point of execution

entry point

The Cooker instructed to run the program will generate an interpreter by reading a Rice source file. The interpreter calls the method to start execution.

The method for starting execution and its call are called entry point. In Cooker, two methods of the main class can be entry point.

open method void start(browser)

open method void start()

The main class must define either.

open method void start(browser)

Cooker has two browsers and Script-tiles. If you need a browser that corresponds to the tile that was executed, define this method.

An instance of the browser class is passed as a method argument. The argument is the Main-browser if executed from the left tile, otherwise it is the Sub-browser.

1:

open method void start(browser br)

2:

// Method definition.

3:

endmethod

If system.cook defines this method, the argument is Main-browser.

open method void start()

If the correspondence between the executed tile and the browser is not important, define this method.

1:

open method void start()

2:

// Method definition.

3:

endmethod

Priority

If the main class has both methods, the call to the start(browser) method takes precedence.

Copyright © Cooker All rights reserved.