! a: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (cond not moved to ! a)
m (Text replacement - " +↵" to " ")
 
(93 intermediate revisions by 15 users not shown)
Line 1: Line 1:
back to [[Scripting_Reference#.23|COMREF]]
{{RV|type=command


<h2 style="color:#000066">''' ! ''a'' '''</h2>
|sortKey= #


|game1= ofp
|version1= 1.00


'''Operand types:'''
|game2= ofpe
|version2= 1.00


'''a:''' [[Boolean]]
|game3= arma1
|version3= 1.00


'''Type of returned value:'''
|game4= arma2
|version4= 1.00


[[Boolean]]
|game5= arma2oa
|version5= 1.50


'''Description:'''
|game6= tkoh
|version6= 1.00


<b>not</b> a
|game7= arma3
|version7= 0.50


|gr1= Variables
|gr2= Math


'''Example:'''
|descr= Returns the negation of a Boolean expression. This means {{hl|[[true]]}} becomes {{hl|[[false]]}} and vice versa.


'''!''' [[true]] ............ Result is false
|alias= [[not]]
 
|s1= [[! a|!]] a
 
|p1= a: [[Boolean]]
 
|r1= [[Boolean]]
 
|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>
 
|seealso= [[not]] [[Operators]]
}}

Latest revision as of 13:44, 26 March 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