! a: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|game1= ofp |version1= 1.00 " to "|game1= ofp |version1= 1.00 |game2= arma |version2= 1.00 |game3= arma2 |version3= 1.00 |game4= arma2oa |version4= 1.55 |game5= tkoh |version5= 1.00 |game6= arma3 |version6= 1.00")
m (Text replacement - "<sqf>([^↵][^\/]*↵[^\/]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(25 intermediate revisions by 2 users not shown)
Line 4: Line 4:


|game1= ofp
|game1= ofp
|version1= 1.00
|version1= 1.00


|game2= arma
|game2= ofpe
 
|version2= 1.00
|version2= 1.00


|game3= arma2
|game3= arma1
 
|version3= 1.00
|version3= 1.00


|game4= arma2oa
|game4= arma2
|version4= 1.00


|version4= 1.55
|game5= arma2oa
|version5= 1.50


|game5= tkoh
|game6= tkoh
 
|version6= 1.00
|version5= 1.00


|game6= arma3
|game7= arma3
|version7= 0.50


|version6= 1.00
|gr1= Variables
|gr1= Variables
|gr2= Math
|gr2= Math


|descr= Returns the negation of a Boolean expression. That means <tt>[[true]]</tt> becomes <tt>[[false]]</tt> and vice versa.
|descr= Returns the negation of a Boolean expression. This means {{hl|[[true]]}} becomes {{hl|[[false]]}} and vice versa.
 
|alias= [[not]]


|s1= '''!''' a
|s1= [[! a|!]] a


|p1= a: [[Boolean]]
|p1= a: [[Boolean]]
Line 38: Line 38:


|x1= The code
|x1= The code
<code>[[private]] _isAlive = [[alive]] [[player]];
<sqf>
[[if]] ([[!_a|!]]_isAlive) [[then]] {
private _isAlive = alive player;
[[hint]] "The player is dead!";
if (!_isAlive) then
}</code>
{
hint "The player is dead!";
};
</sqf>
is the same as
is the same as
<code>[[private]] _isAlive = [[alive]] [[player]];
<sqf>
[[if]] ([[not]] _isAlive) [[then]] {
private _isAlive = alive player;
[[hint]] "The player is dead!";
if (not _isAlive) then
}</code>  
{
hint "The player is dead!";
};
</sqf>


|seealso= [[not]], [[Operators]]  
|seealso= [[not]] [[Operators]]
}}
}}
[[Category:Scripting Commands OFP 1.99]]
[[Category:Scripting Commands OFP 1.96]]
[[Category:Scripting Commands OFP 1.46]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}

Latest revision as of 21:37, 2 September 2024

Hover & click on the images for description

Description

Description:
Returns the negation of a Boolean expression. This means true becomes false and vice versa.
Alias:
not
Groups:
VariablesMath

Syntax

Syntax:
! a
Parameters:
a: Boolean
Return Value:
Boolean

Examples

Example 1:
The code
private _isAlive = alive player; if (!_isAlive) then { hint "The player is dead!"; };
is the same as
private _isAlive = alive player; if (not _isAlive) then { hint "The player is dead!"; };

Additional Information

See also:
not Operators

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note