Difference between revisions of "Variables/Boolean"

From HIVE
Jump to navigation Jump to search
m (1 revision: StarEdit.net Wiki)
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''Boolean''' [[variables]] can be used as switches. They basically have 2 states: '''True''' and '''False''' (or "'''On''' and '''Off'''" or "'''1''' and '''0'''").
+
'''Boolean''' [[Variables]] can be used as switches. They basically have 2 states: '''True''' and '''False''' (or "'''On''' and '''Off'''", or "'''1''' and '''0'''").
 +
 
 +
A '''Boolean''' variable uses the least memory compared to other variable types. The reason for this is a '''Boolean''' value can only be 1 or 0. Whereas, compared to an Integer Value, which can be anything from  −32,768 to 32,767 (may need verification). For this reason, it is recommended to use '''Booleans''' whereever possible.
  
A '''Boolean''' variable uses the least memory compared to other variable types. The reason for this is a '''Boolean''' value can only be 1 or 0. Whereas, compared to an Integer Value, which can be anything from  −32,768 to 32,767 (I believe). For this reason, it is recommended to use '''Boolean's''' where-ever possible.
 
 
[[Category:StarCraft II]]
 
[[Category:StarCraft II]]
 
[[Category:Triggers]]
 
[[Category:Triggers]]
 
[[Category:Reference]]
 
[[Category:Reference]]

Latest revision as of 10:16, 27 March 2013

Boolean Variables can be used as switches. They basically have 2 states: True and False (or "On and Off", or "1 and 0").

A Boolean variable uses the least memory compared to other variable types. The reason for this is a Boolean value can only be 1 or 0. Whereas, compared to an Integer Value, which can be anything from −32,768 to 32,767 (may need verification). For this reason, it is recommended to use Booleans whereever possible.