All Scripting and programming languages execute commands in a defined order. This execution order is generally 'top to bottom'. SWiSHscript also performs commands in a top-to-bottom manner. This general order of execution can be altered through the use of Flow Control commands.
Flow Control commands can be categorised into Looping, Conditional and Function call commands.
Looping commands repeat a section of code until a certain condition becomes false. Available looping commands are:
Conditional commands allow specific sections of script to be executed if a certain condition is true or false. Available conditional commands are:
Function call commands cause the execution flow to move to the named function, execute code within that function and return to original location after a return command is encountered in the named function. Available commands are: