merge: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Merge → merge)
m (Minor fixes)
Line 7: Line 7:
|gr1= HashMap
|gr1= HashMap


|descr= Merges two [[HashMap|HashMaps]].
|descr= Merges two [[HashMap]]s.


|s1= hashMap1 [[merge]] hashMap2
|s1= hashMap1 [[merge]] hashMap2
Line 13: Line 13:
|p1= hashMap1: [[HashMap]] - This HashMap will be modified
|p1= hashMap1: [[HashMap]] - This HashMap will be modified


|p2= hashMap2: [[HashMap]] - All key-value pairs from this HashMap are added to '''hashMap1'''. If a key from '''hashMap2''' already exists in '''hashMap1''', then its value is overwritten with the corresponding value from '''hashMap2'''
|p2= hashMap2: [[HashMap]] - All key-value pairs from this HashMap are added to ''hashMap1''. If a key from ''hashMap2'' already exists in ''hashMap1'', then its value is overwritten with the corresponding value from ''hashMap2''


|r1= [[Nothing]]
|r1= [[Nothing]]
Line 21: Line 21:
|p21= hashMap1: [[HashMap]] - This HashMap will be modified
|p21= hashMap1: [[HashMap]] - This HashMap will be modified


|p22= hashMap2: [[HashMap]] - All key-value pairs from this HashMap are added to '''hashMap1'''
|p22= hashMap2: [[HashMap]] - All key-value pairs from this HashMap are added to ''hashMap1''


|p23= overwriteExisting (Optional, default: [[false]]): [[Boolean]] - If [[true]], keys from '''hashMap1''' that also exist in '''hashMap2''' are overwritten. When set to [[true]] [[merge]] is faster
|p23= overwriteExisting (Optional, default: [[false]]): [[Boolean]] - If [[true]], keys from ''hashMap1'' that also exist in ''hashMap2'' are overwritten. When set to [[true]], merging is faster


|r2= [[Nothing]]
|r2= [[Nothing]]

Revision as of 15:58, 29 January 2021

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 2.04|2.04]]
Hover & click on the images for description

Description

Description:
Merges two HashMaps.
Groups:
HashMap

Syntax

Syntax:
hashMap1 merge hashMap2
Parameters:
hashMap1: HashMap - This HashMap will be modified
hashMap2: HashMap - All key-value pairs from this HashMap are added to hashMap1. If a key from hashMap2 already exists in hashMap1, then its value is overwritten with the corresponding value from hashMap2
Return Value:
Nothing

Alternative Syntax

Syntax:
hashMap1 merge [hashMap2, overwriteExisting]
Parameters:
hashMap1: HashMap - This HashMap will be modified
hashMap2: HashMap - All key-value pairs from this HashMap are added to hashMap1
overwriteExisting (Optional, default: false): Boolean - If true, keys from hashMap1 that also exist in hashMap2 are overwritten. When set to true, merging is faster
Return Value:
Nothing

Examples

Example 1:
_hashMap merge _otherHashMap;

Additional Information

See also:
insert set

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

[[Category:Introduced with arma3dev version 2.04]][[ Category: arma3dev: New Scripting Commands | MERGE]][[ Category: arma3dev: Scripting Commands | MERGE]]