TRUE

From Second Life Wiki
Revision as of 07:27, 2 January 2012 by Shadow Siamendes (Talk | contribs)

Jump to: navigation, search

Description

Constant: integer TRUE = 1;

The integer constant TRUE has the value 1

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

Related Articles

Constants

•  FALSE

Articles

•  boolean

Examples

<lsl>integer q;

default {

   state_entry()
   {
       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");
       }
   }

}</lsl>

Deep Notes

Search JIRA for related Issues

Signature

integer TRUE = 1;