Difference between revisions of "FALSE"

From Second Life Wiki
Jump to: navigation, search
m (This is a sanity test.)
m (<lsl> tag to <source>)
 
Line 6: Line 6:
 
|desc=Constant used to define the FALSE value in conditional structures or variables/constants in general. Usually it's used because it is more readable, indicating a [[Boolean|boolean]] value instead a [[Integer|integer]] value (0).
 
|desc=Constant used to define the FALSE value in conditional structures or variables/constants in general. Usually it's used because it is more readable, indicating a [[Boolean|boolean]] value instead a [[Integer|integer]] value (0).
 
|examples=
 
|examples=
<lsl>
+
<source lang="lsl2">
 
integer is_owner(key inputKey)
 
integer is_owner(key inputKey)
 
{
 
{
Line 27: Line 27:
 
     }
 
     }
 
}
 
}
</lsl>
+
</source>
<lsl>
+
<source lang="lsl2">
 
default
 
default
 
{
 
{
Line 63: Line 63:
 
     }
 
     }
 
}
 
}
</lsl>
+
</source>
 
|constants={{LSL ConstRow|TRUE}}
 
|constants={{LSL ConstRow|TRUE}}
 
|functions=
 
|functions=

Latest revision as of 14:36, 23 January 2015

Description

Constant: integer FALSE = 0;

The boolean integer constant FALSE has the value 0

Constant used to define the FALSE value in conditional structures or variables/constants in general. Usually it's used because it is more readable, indicating a boolean value instead a integer value (0).

Related Articles

Constants

•  TRUE

Articles

•  boolean

Examples

integer is_owner(key inputKey)
{
    if (inputKey == llGetOwner() )
        return TRUE;
//  else
        return FALSE;
}
 
default
{
    touch_start(integer num_detected)
    {
        key id = llDetectedKey(0);
 
        if ( is_owner(id) )
            llSay(0, "Hello, you're my owner!");
        else
            llSay(0, "Hello, you're not my owner!");
    }
}
default
{
    state_entry()
    {
        integer q = TRUE;
        if(q)
        {
            llSay(0, "TRUE");
            q = FALSE;
            if(!q)
            {
                llSay(0, "FALSE");
                q = TRUE;
                if(!q)
                    llSay(0, "Won't say this.");
 
                else
                {
                    llSay(0, "TRUE");
                    q = FALSE;
                    if(q)
                        llSay(0, "Won't say this.");
 
                    else
                        llSay(0, "FALSE");
                }
            }
            else
                llSay(0, "Won't say this.");
        }
        else
            llSay(0, "Won't say this.");
    }
}

Deep Notes

Search JIRA for related Issues

Signature

integer FALSE = 0;