Arrays
36 scripting commands. Also as Markdown for agents.
- +Add two Numbers, concatenate two Arrays or two Strings, or create a copy of an Array or HashMap.
- -Subtracts numbers or arrays from each another, negates a number. For arrays also see deleteAt and deleteRange.
- appendAppends array2 to the back of array1 modifying array1. See insert for an "appendUnique" equivalent.
- applyApplies the given code to each element of the given data structure and collects the results in an array.
- arrayIntersectIntersects two arrays returning an array of unique common elements, avoiding nil values. Using the same array as both parameters will return unique…
- countCan be used to count: - The number of elements in an array (returns the already internally known array size) - The number of elements in an array…
- createHashMapFromArrayCreates a new HashMap and initializes it from a key-value pair array
- deleteAtRemoves array element at the given index and returns removed element (modifies the original array, just like resize or set).
- deleteRangeRemoves a range of array elements from the given array. Modifies the original array, just like resize or set.
- findSearches for an array element within an array or an ANSI string within an ANSI string.
- findAnyReturns the zero-based index of the first element in array A that also exists in array B. If no common elements exist it returns -1.
- findIfSearches for an element within array for which the code evaluates to true. Returns the zero-based index on success or -1 if not found.
- flattenFlattens an array.
- forEachExecutes the given command(s) on every item of an Array or a HashMap.
- forEachReversedExecutes the given command(s) on every item of an Array in reversed order, compared to forEach.
- inChecks whether value is in array, unit is in vehicle, position is inside location or ANSI string is part of other ANSI string. If Unicode support is…
- insertInserts multiple values into Array/String/HashMap.
- isArrayCheck if config entry represents array.
- isEqualTypeAllCompares types of all elements of an array to the type of a single value. Since Arma 3 v2.09.149634 no additional check is needed to make sure the…
- isEqualTypeArrayCompares types of all elements of one array to types of all elements of another array. Since Arma 3 v2.09.149634 no additional check is needed to…
- paramExtracts a single value with given index from input argument, similar to BIS_fnc_param.
- paramsParses input argument into array of private variables. When used without argument, as shown in main syntax, internal variable _this, which is usually…
- parseSimpleArrayConverts given, formatted as simple array, String into a valid Array. Simple array is array consisting of Numbers, Strings, Booleans and Arrays of…
- pushBackInsert an element to the back of the given array. This command modifies the original array. (see also: pushBackUnique)
- pushBackUniqueAdds element to the back of the given array but only if it is unique to the array. The index of the added element is returned upon success, otherwise…
- resizeChanges the size of the given array. The command does not return new array, it resizes the source array to the desired number of elements.
- reverseReverses given array by reference (modifies the original array, just like resize). The alternative syntax can be used to reverse a ANSI string. If…
- selectSelects an element from an array, config entry from Config or substring from a string or a range from an array.
- selectMaxReturns the array element with maximum numerical value. Engine solution to BIS_fnc_greatestNum and BIS_fnc_findExtreme. Therefore it is expected that…
- selectMinReturns the array element with minimum numerical value. Engine solution to BIS_fnc_lowestNum and BIS_fnc_findExtreme. Therefore it is expected that…
- selectRandomReturns a random element from the given array. Engine solution to BIS_fnc_selectRandom
- selectRandomWeightedReturns a random element from the given array according to assigned weights. Engine solution to BIS_fnc_selectRandomWeighted.
- setChanges the element at the given zero-based index of the array.
- sortAttempts to sort given array either in ascending (true) or descending (false) order.
- toArrayConverts the supplied String into an Array of Numbers. The numbers in the created array are the decimal Unicode representations of characters.
- toStringConverts the supplied Array of Numbers into a String through <https://en.wikipedia.org/wiki/Unicode> characters representation conversion, or…