a - b

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Operation Flashpoint version 1.00

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

Description:
For numbers: a minus b.

Syntax

Syntax:
a - b
Parameters:
a: Number or Array
b: Number or Array
Return Value:
Number or Array

Examples

Example 1:
Number
_sum = 10 - 7
Result: _sum is 3
Example 2:
For arrays: Contents of array b removed from array a.
Array
_result = [1,2,2,player,"String"] - [2,player,player,"String"]
_result is [1]

Additional Information

Multiplayer:
Behaviour unknown.
See also:
Array, Operators

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

Note that this way of removing elements from an array will not work if those elements are themselves arrays.

Example:

[[0,0,0],[1,1,1],[2,2,2] ] - [1,1,1]

Will not remove the element [1,1,1] from the first array.

A more practical example:

[ getPos unit1, getPos unit2, getPos unit3] - getPos unit3

Will not remove the position of unit3 from the first array.


Bottom Section

Personal tools
Buy ArmA now!