Entry points

Entry points form the mechanism for passing control from Switch to a script in a structured manner. Specifically, an entry point is a function defined in a script (according to the rules specified below) and intended to be called from the Switch application. All other functions defined in the scripting API work the other way around: they expect to be called from a script.

Switch invokes the entry points defined in a script at certain appropriate times, as explained below. Also see execution modes.

The first argument for each entry point is an instance of the Switch class or of the Environment class. This object serves as the starting point for accessing the information offered by the flow element and metadata modules in the scripting API.

Contents