Don't click here unless you want to be banned.

LSL Wiki : condition

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org

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:
if (isAwesome) {
    llOwnerSay("w00t! This is awesome!");
} else {
    llOwnerSay("Aww, this is lame :-|");
}

while(isAwesome) {
    llOwnerSay("Awesome!");
}
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
There is no comment on this page. [Display comments/form]