! a: Difference between revisions

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


| ofp |Game Name=
|sortKey= #


|1.00|Game Version=
|game1= ofp
|version1= 1.00


|gr1= Variables |GROUP1=
|game2= ofpe
|gr2= Math |GROUP2=
|version2= 1.00
____________________________________________________________________________________________


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


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


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


| [[Boolean]] |RETURNVALUE=
|game6= tkoh
____________________________________________________________________________________________
|version6= 1.00


|x1= The code
|game7= arma3
<code>_a = [[alive]] [[player]];
|version7= 0.50
[[if]] ([[!_a]]) [[then]] {
 
    [[hint]] "The player is dead!";
|gr1= Variables
}</code>
|gr2= Math
is the same as
 
<code>_a = [[alive]] [[player]];
|descr= Returns the negation of a Boolean expression. This means {{hl|[[true]]}} becomes {{hl|[[false]]}} and vice versa.
[[if]] [[not]] (_a) [[then]] {
    [[hint]] "The player is dead!";
}</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[not]], [[Operators]] |SEEALSO=
|alias= [[not]]


}}
|s1= [[! a|!]] a


<h3 style="display:none">Notes</h3>
|p1= a: [[Boolean]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|r1= [[Boolean]]
</dl>


<h3 style="display:none">Bottom Section</h3>
|x1= The code
<sqf>private _isAlive = alive player;
if (!_isAlive) then
{
hint "The player is dead!";
};</sqf>
is the same as
<sqf>private _isAlive = alive player;
if (not _isAlive) then
{
hint "The player is dead!";
};</sqf>  


[[Category:Scripting Commands|#]]
|seealso= [[not]] [[Operators]]  
[[Category:Scripting Commands OFP 1.99|#]]
}}
[[Category:Scripting Commands OFP 1.96|#]]
[[Category:Scripting Commands OFP 1.46|#]]
[[Category:Scripting Commands Armed Assault|#]]
[[Category:Scripting Commands Arma 2|#]]
[[Category:Scripting Commands Arma 3|#]]
[[Category:Command_Group:_Math|#]]
[[Category:Command_Group:_Variables|#]]

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