! a: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (Some wiki formatting)
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| ofp
|sortKey= #


|1.00
|game1= ofp
|version1= 1.00


|gr1= Variables
|game2= ofpe
|gr2= Math
|version2= 1.00


| Returns a negation of Boolean expression. That means <tt>[[true]]</tt> becomes <tt>[[false]]</tt> and vice versa.  
|game3= arma1
|version3= 1.00


| [[Boolean]] <nowiki>=</nowiki> '''!''' a
|game4= arma2
|version4= 1.00


|p1= a: [[Boolean]]
|game5= arma2oa
|version5= 1.50


| [[Boolean]]  
|game6= tkoh
|version6= 1.00
 
|game7= arma3
|version7= 0.50
 
|gr1= Variables
|gr2= Math
 
|descr= Returns the negation of a Boolean expression. This means {{hl|[[true]]}} becomes {{hl|[[false]]}} and vice versa.
 
|alias= [[not]]
 
|s1= [[! a|!]] a
 
|p1= a: [[Boolean]]
 
|r1= [[Boolean]]


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


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

Revision as of 17:45, 13 May 2022

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