Boolean: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Reverted edits by Heecf..... (talk) to last revision by RKurtzDmitriyev)
mNo edit summary
Line 2: Line 2:
Boolean ([[true]] or [[false]]).
Boolean ([[true]] or [[false]]).


Note that Booleans are '''real''' types in the scripting language.
If left unmolested true and false are "strings";
 
In the scripting language (sqf/sqs) this is fine. The variable is [[compared]] as a string "true" or "false" or "bananas"
 
in config.cpp you need to first declare them for what they really are
 
#define true 1
#define false 0


In config.cpp (addons), a boolean is simply a poetic licence, a convenience, for a zero/non zero [[Integer]].


[[Category: Data Types]]
[[Category: Data Types]]

Revision as of 22:57, 12 July 2016

Boolean Type

Boolean (true or false).

If left unmolested true and false are "strings";

In the scripting language (sqf/sqs) this is fine. The variable is compared as a string "true" or "false" or "bananas"

in config.cpp you need to first declare them for what they really are

  1. define true 1
  2. define false 0