Boolean: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Added information on booleans in other file types in the engine)
Line 3: Line 3:
|de=Boolean:de
|de=Boolean:de
}}
}}
A '''boolean''' value is either "on" or "off". When enabled it is denoted with <code>true</code> or <code>1</code>, and when disabled it is denoted with <code>false</code> or <code>0</code>.
A '''boolean''' value is a toggle used in programming that is inherently exclusively either "on" or "off". When ''enabled'' it is denoted with <code>true</code> or <code>1</code>, and with <code>false</code> or <code>0</code> when ''disabled'', depending on the syntax of the language being used.


[[Material]]s use 1 and 0. C++ code generally uses true and false.
Its use varies in different areas of the engine:
 
* C++ code ''generally'' uses <code>true / false</code>
* [[material|Materials]] use <code>1 / 0</code>
* [[Weapon_script|Weapon Scripts]] use <code>1 / 0</code>
* [[VMF|.VMF]] files use <code>1 / 0</code>
* [[DMX|.DMX]] files {{todo|Verify how, and which form}}
 
Certain file types used in Source also do not ''typically'' use booleans:
* [[QC|.QC]] files
* [[Studiomdl_Data|.SMD]] files


[[Category:Glossary]]
[[Category:Glossary]]
[[Category:English]]
[[Category:English]]

Revision as of 05:21, 24 March 2018

Template:Otherlang2 A boolean value is a toggle used in programming that is inherently exclusively either "on" or "off". When enabled it is denoted with true or 1, and with false or 0 when disabled, depending on the syntax of the language being used.

Its use varies in different areas of the engine:

Certain file types used in Source also do not typically use booleans: