Description: This statement sets the next state to start when the action script completes.
Returns: Nothing
Usage: Script
Format: ForceState(State)
Parameters: State { text } { required } { no default: }
Any text expression giving the name of the state to start upon completion of the script.
Comments: This statement does not act like an exit point from the script - the script will still run in its entirety. If, however, the script transfer condition did not specify a different state to transfer to, this function will stop the current state. Multiple ForceState statements may be executed in a script, with the last one executed setting the state to which the module will switch.
Example:
If TimeOut(1, 1) Main;
[
IfThen(level < 10, ForceState("Exit"));
]
After one second this statement will cause a state transfer to Main. However, if level is less than 10 at that time, the next state will become Exit rather than Main.
See Also: