Condition
A
condition is often used to reference
statements within a
flow-control statement's parenthesis. Conditions determine whether the
code contained within the
conditional statement's block should be executed.
Example:
In this case,
isAwesome is the
condition.
Note: Because of the way LSL parser works (more details:
http://w-hat.com/stackdepth), conditions in LSL are evaluated left to right, instead of right to left as in most programming languages.
Example:
integer true()
{
llSay(0, "true");
return TRUE;
}
integer false()
{
llSay(0, "false");
return FALSE;
}
default
{
touch_start(integer total_number)
{
// displays this result:
// Object: true
// Object: false
if (false() && true())
llSay(0, "paradox alert");
}
}
statement |
code |
do-while |
if-else |
while