insert: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "{{Command " to "{{RV|type=command ") |
m (command group) |
||
Line 6: | Line 6: | ||
|gr1= HashMap | |gr1= HashMap | ||
|gr2= Arrays | |gr2= Arrays | ||
|gr2= Strings | |||
|descr= Inserts multiple values into [[Array]]/[[String]]/[[HashMap]].<br> | |descr= Inserts multiple values into [[Array]]/[[String]]/[[HashMap]].<br> | ||
Line 14: | Line 17: | ||
|p1= array : [[Array]] | |p1= array : [[Array]] | ||
|p2= index: [[Number]] - index at which the values will be inserted, -1 for append. | |p2= index: [[Number]] - index at which the values will be inserted, -1 for append. | ||
|p3= [value1, value2, ...]: [[Array]] of [[Anything]] - Values to insert at the specified index | |p3= [value1, value2, ...]: [[Array]] of [[Anything]] - Values to insert at the specified index | ||
|p4= onlyIfUnique: [[Bool]] - Only insert if the value is unique in the array, like [[pushBackUnique]] | |p4= onlyIfUnique: [[Bool]] - Only insert if the value is unique in the array, like [[pushBackUnique]] | ||
Line 23: | Line 29: | ||
|p21= string : [[String]] | |p21= string : [[String]] | ||
|p22= index: [[Number]] - index at which the values will be inserted, -1 for append. | |p22= index: [[Number]] - index at which the values will be inserted, -1 for append. | ||
|p23= substring: [[String]] - String to insert | |p23= substring: [[String]] - String to insert | ||
Line 31: | Line 39: | ||
|p41= hashMap: [[HashMap]] | |p41= hashMap: [[HashMap]] | ||
|p42= key: [[HashMapKey]] | |p42= key: [[HashMapKey]] | ||
|p43= value: [[Anything]] | |p43= value: [[Anything]] | ||
|r3= [[Nothing]] | |r3= [[Nothing]] | ||
|x1= | |x1= | ||
|x2= | |x2= | ||
|seealso= [[HashMap]] | |seealso= [[HashMap]] | ||
}} | }} |
Revision as of 10:07, 24 January 2021
Description
- Description:
- Inserts multiple values into Array/String/HashMap.
The String variant also supports forceUnicode. - Groups:
- HashMapStrings
Syntax 1
- Syntax:
- array insert [index, [value1, value2, ...], onlyIfUnique]
- Parameters:
- array : Array
- index: Number - index at which the values will be inserted, -1 for append.
- [value1, value2, ...]: Array of Anything - Values to insert at the specified index
- onlyIfUnique: Bool - Only insert if the value is unique in the array, like pushBackUnique
- Return Value:
- Nothing
Syntax 2
- Syntax:
- string insert [index, substring]
- Parameters:
- string : String
- index: Number - index at which the values will be inserted, -1 for append.
- substring: String - String to insert
- Return Value:
- String - The new string
Syntax 3
- Syntax:
- hashMap insert [[key1, value1], [key2, value2], ...]
- Parameters:
- hashMap: HashMap
- key: HashMapKey
- value: Anything
- Return Value:
- Nothing
Examples
- Examples:
- Example needed
Additional Information
- See also:
- HashMap
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.01]][[ Category: arma3dev: New Scripting Commands | INSERT]][[ Category: arma3dev: Scripting Commands | INSERT]]