Script Syntax: Flow Control Keywords
- Last Updated: December 11, 2024
- 1 minute read
- WhatsUp Gold
- Version 2024
The following Flow Control keywords are used in a script to return "error" or "success" responses of steps within that script.
- IfState. This checks for the current state (ok or error) and jumps to a label if true.Valid syntax:
IfState {ERR|OK} labelExample:IfState ERR EndIfState OK Bye - Goto. This immediately jumps to a label.Valid syntax:
Goto EndExample:Goto End - Exit. This immediately ends the script with an optional state (ok or error). The optional state overrides the current state.Valid syntax:
Exit {ERR|OK}Example:Exit ERRExit OK - :Label. This defines a label that can be the target of a jump. A label is defined by a single word beginning with the ":" character.Valid syntax:
:(with a name following)Example:Bye - OnError. This allows for a global handling of an error situationValid Syntax:
OnError {EXIT|CONTINUE|GOTO} labelExample:OnError EXIT (Default behavior)OnError CONTINUEOnError GOTO Logoff