{"name":"BIS_fnc_errorParamsType","title":"BIS fnc errorParamsType","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_errorParamsType","revid":348544,"updated":"2023-11-08T13:06:09Z","groups":["Diagnostic"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","locality":{"effect":"local"},"description":"Displays a parameter type error message (using BIS_fnc_error) explaining the problem.","syntaxes":[{"syntax":"[value, method, expected] call BIS_fnc_errorParamsType","params":[{"name":"value","type":"Anything","optional":true,"default":"nil","description":"value received.","type_expr":"Anything","text":"**value**: Anything - (Optional, default nil) value received."},{"name":"method","type":"String","optional":true,"default":"\"\"","description":"validation method, can be one of:\n\n- \"isEqualType\"\n- \"isEqualTypeArray\"\n- \"isEqualTypeAll\"\n- \"isEqualTypeAny\"\n- \"isEqualTypeParams\"","type_expr":"String","text":"**method**: String - (Optional, default \"\") validation method, can be one of:\n\n- \"isEqualType\"\n- \"isEqualTypeArray\"\n- \"isEqualTypeAll\"\n- \"isEqualTypeAny\"\n- \"isEqualTypeParams\""},{"name":"expected","type":"Anything","optional":true,"default":"nil","description":"expected type.","type_expr":"Anything","text":"**expected** (Optional, default: nil): Anything - expected type."}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"code":["// show error and abort if input is not of type ARRAY:\nif !(_this isEqualType []) exitWith { [_this, \"isEqualType\", []] call BIS_fnc_errorParamsType; };"]},{"code":["// show error and abort if array input is not in format [SCALAR, STRING, BOOL]:\nif !(_this isEqualTypeArray [0, \"\", true]) exitWith { [_this, \"isEqualTypeArray\", [0, \"\", true]] call BIS_fnc_errorParamsType; };"]},{"code":["// show error and abort if array input is not in format [BOOL, BOOL, BOOL, ...]:\nif !(_this isEqualTypeAll true) exitWith { [_this, \"isEqualTypeAll\", true] call BIS_fnc_errorParamsType; };"]},{"code":["// show error and abort if input is neither ARRAY nor OBJECT:\nif !(_this isEqualTypeAny [[], objNull]) exitWith { [_this, \"isEqualTypeAny\", [[], objNull]] call BIS_fnc_errorParamsType; };"]},{"code":["// show error and abort if input is neither of type ARRAY nor array in format [SCALAR, ARRAY, <ANYTHING>, OBJECT]:\nif !(_this isEqualTypeParams [0, [], nil, objNull]) exitWith { [_this, \"isEqualTypeParams\", [0, [], nil, objNull]] call BIS_fnc_errorParamsType; };"]}],"see_also":["BIS_fnc_error"]}