Unofficial LSL Reference

[[constants:logic:start]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Logic constants

The logic constants are the integer constants TRUE and FALSE. While the constant TRUE has the value 1, in general any integer value different to 0 will serve as a truth value of true (see Boolean).

Name Value
FALSE 0
TRUE 1

TRUE and FALSE are special in that, unlike all other constants, neither of them can be prefixed by a minus sign in either the globals section or after a typecast, for example:

integer a = -TRUE; // Syntax error
integer b = -LINK_ROOT; // Valid
 
default
{
    state_entry()
    {
        integer c = (integer)-FALSE; // Syntax error
        integer d = (integer)-LINK_ROOT; // Valid
    }
}

See also