a - b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Reverted to revision 104445 by x39 on 2017-09-20T00:01:29Z)
(#REDIRECT -)
 
Line 1: Line 1:
{{Command|= Comments
#REDIRECT [[-]]
____________________________________________________________________________________________
 
| ofp |= Game name
 
|1.00|= Game version
____________________________________________________________________________________________
 
| Subtracts '''b''' from '''a'''. '''a''' and '''b''' need to be of the same type, both [[Number]]s or both [[Array]]s. In Arma 3 it is possible to subtract nested arrays. |= Description
____________________________________________________________________________________________
 
| a '''-''' b |= Syntax
 
|p1 = a: [[Number]] or [[Array]]
 
|p2 = b: [[Number]] or [[Array]]
 
| [[Number]] or [[Array]]  |= Return value
____________________________________________________________________________________________
|x1 = For numbers: <code>_sum = 10 - 7; //_sum is 3</code>|=
 
|x2 = For arrays: contents of array '''b''' removed from array '''a'''. Returns new array.<code>_result = [1, 2, 2, [[player]], "String"] - [2, [[player]], [[player]], "String"]; //_result is [1]</code>|=
 
|x3 = Compare:<code>[0,[0],<nowiki>[</nowiki>[0]]] - [0]; //<nowiki>[</nowiki>[0],<nowiki>[</nowiki>[0]]]
[0,[0],<nowiki>[</nowiki>[0]]] - <nowiki>[</nowiki>[0]]; //[0,<nowiki>[</nowiki>[0]]] - Arma 3 only
[0,[0],<nowiki>[</nowiki>[0]]] - <nowiki>[</nowiki><nowiki>[</nowiki>[0]]]; //[0,[0]] - Arma 3 only</code>|=
 
| [[Array]], [[Operators]] |= See also
 
}}
 
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
 
 
[[Category:Scripting Commands|#]]
[[Category:Scripting Commands OFP 1.99|#]]
[[Category:Scripting Commands OFP 1.96|#]]
[[Category:Scripting Commands OFP 1.46|#]]
[[Category:Scripting Commands ArmA|#]]
[[Category:Scripting Commands ArmA2|#]]
[[Category:Scripting Commands Arma 3|#]]
[[Category:Command_Group:_Math|#]]
[[Category:Command_Group:_Variables|#]]
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]

Latest revision as of 23:26, 6 February 2019

Redirect to: