Difference between revisions of "ObjectType:bool"

From Lavish Software Wiki
Jump to navigation Jump to search
m (DataType:bool moved to ObjectType:bool)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{ObjectType-Vitals|bool|[[LavishScript]]|none|'''TRUE''' or '''FALSE'''|bool|no|unsigned int}}
 
== Description ==
 
== Description ==
 +
 
Short for <tt>boolean</tt>, a bool groups all numbers into exactly two categories, one called [[LavishScript:TRUE|TRUE]] and one called [[LavishScript:FALSE|FALSE]].  The TRUE category is made up of all numbers except for zero, and the FALSE category is made up of only zero.
 
Short for <tt>boolean</tt>, a bool groups all numbers into exactly two categories, one called [[LavishScript:TRUE|TRUE]] and one called [[LavishScript:FALSE|FALSE]].  The TRUE category is made up of all numbers except for zero, and the FALSE category is made up of only zero.
  
 
== Members ==
 
== Members ==
''(none)''
+
* [[ObjectType:bool|bool]] '''Not''': Gives the opposite value, e.g. if the value is TRUE, Not is FALSE
 +
* [[ObjectType:bool|bool]] '''Equal['''calculation''']''': TRUE if the boolean value matches the boolean result of the calculation (zero is FALSE, non-zero is TRUE)
 +
* [[ObjectType:string|string]] '''AsJSON''': A string containing '''true''' or '''false''' as would be specified in JSON
  
 
== Methods ==
 
== Methods ==
 
* '''Toggle''': Toggles between TRUE and FALSE
 
* '''Toggle''': Toggles between TRUE and FALSE
 
* '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this bool to a specific value
 
* '''Set['''[[LavishScript:Mathematical Formulae|formula]]''']''': Sets this bool to a specific value
 
== Returns ==
 
'''TRUE''' or '''FALSE'''
 
  
 
== Examples ==
 
== Examples ==
Line 19: Line 20:
 
===Toggle a boolean value===
 
===Toggle a boolean value===
 
*Boo1:Toggle
 
*Boo1:Toggle
 
== Operates On ==
 
<tt>unsigned int</tt>
 
  
 
== See Also ==
 
== See Also ==
* [[LavishScript:Data Types|Data Types]]
+
{{LavishScript:ObjectType}}
 
 
[[Category:LavishScript]]
 
[[Category:LavishScript Data Types]]
 

Latest revision as of 14:12, 14 October 2019

Object Type Vitals
bool
Defined By LavishScript
Inherits none
Reduces To TRUE or FALSE
Variable Object Type bool
Uses Sub-Types no
C/C++ Type unsigned int

Description

Short for boolean, a bool groups all numbers into exactly two categories, one called TRUE and one called FALSE. The TRUE category is made up of all numbers except for zero, and the FALSE category is made up of only zero.

Members

  • bool Not: Gives the opposite value, e.g. if the value is TRUE, Not is FALSE
  • bool Equal[calculation]: TRUE if the boolean value matches the boolean result of the calculation (zero is FALSE, non-zero is TRUE)
  • string AsJSON: A string containing true or false as would be specified in JSON

Methods

  • Toggle: Toggles between TRUE and FALSE
  • Set[formula]: Sets this bool to a specific value

Examples

Declare a boolean variable

  • declare Boo1 bool FALSE

Set a boolean value

  • Boo1:Set[TRUE]

Toggle a boolean value

  • Boo1:Toggle

See Also

LavishScript Object Types