argument param [index, defaultValue, expectedDataTypes, expectedArrayCount]

Operand types

argument: Anything
[index, defaultValue, expectedDataTypes, expectedArrayCount]: Array

Type of returned value

Description

Extracts a single value with given index from input argument, similar to BIS_fnc_param. When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument. If input argument is not an array, it will be converted to 1 element array.

If extracted item of input with given index is undefined, of the wrong type or of the wrong length (if the item is an array), default value is used instead. To log these substitutes into .rpt file, set allowFunctionsLog param in description.ext to 1.

argument: Anything - A usual array of params is expected. If a non-array value is passed, it will be converted to 1 element array

index: Number - index of required item in the input array.
defaultValue (Optional): Anything - a default value to return if input is undefined, of the wrong type or of the wrong length (if the item is an array).
expectedDataTypes (Optional): Array of direct Data Types - checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
expectedArrayCount (Optional): Number or Array - a single size or array of sizes. If passed input value is an array, checks that it has a certain number of elements. If not, default value is used instead. Empty array [] means any size is accepted.

Used In

Arma3

Example

[123] call {
private "_val";
_val = param [0];
};

// Below would produce the same result as above
123 call {
private "_val";
_val = param [0];
};
Search OFPEC COMREF