FANDOM


integer TRUE = 1;

The integer constant TRUE has the value 1.


Example

default 
{
	state_entry()
	{
		if (llGetScriptState("anotherscript") == TRUE)
		{
			llSetScriptState("anotherscript", FALSE);
		}
	}
}

Remarks

Though it is an integer constant, it's use is intended for boolean comparisons or as parameter for functions, that require a boolean value.

Notes

The value 1 can be used instead of the constant TRUE, which is a major difference to some professional programming languages. Still it is suggested, to avoid using 1 instead of TRUE, as it makes more readable code and avoids problems, where scripts could break because of future changes.

Using TRUE and FALSE in boolean expressions, where functions return those values, makes code more readable and failsafe, even if it's correct syntax to write the above example as:

if (llGetScriptState("anotherscript"))

The contrary to TRUE is FALSE.

Related Constants

  • FALSE - An integer constant of value 0 for boolean comparisons

Platforms

SecondLife (agni), Secondlife (aditi), OpenSimulator

See alsoEdit

  • TRUE - Constant reference at SecondLife LSL Wiki
  • TRUE - Constant reference at lslwiki.net


  Icon-edit-22x22 Read comments or write a new one!    

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.