by Brayla Sana | Apr 19, 2016 | Flow Control, LSL, OSSL, Wiki
The for loop is used to execute statements while a condition is true, and executes a line of code after each iteration/cycle/step. More commonly, it executes code a certain number of times, and operates a counter to facilitate it. Format: for (initialization; test;...
by Brayla Sana | Apr 19, 2016 | Uncategorized
LSL and OSSL feature states which scripts can define in many ways, switching back and forth between them using the state directive (example: state default;). States are defined using the keyword state (Example: state foo {…}) with the exception of the...
by Brayla Sana | Apr 19, 2016 | Flow Control, LSL, OSSL, Wiki
A return is a value given when exiting a function or event. The return keyword is used for exiting from functions or events. If a function has a return value, all code paths will need to end in a return statement. Note: The term “return value” is used when...
by Brayla Sana | Apr 19, 2016 | Flow Control, LSL, OSSL, Wiki
jump label A jump is like a goto in other languages. Jumps can be used to alter normal flow control. When a jump occurs, script execution immediately moves to the next statement after the corresponding label definition, skipping intervening code and breaking out...
by Brayla Sana | Apr 19, 2016 | Flow Control, LSL, OSSL, Wiki
Execute some statement(s) if a condition is true, else some other statement(s) if it is false. This is essentially the “bread and butter” of coding: the decision making inside a script. if (condition) statement else statement if (condition) {...