{"name":"BIS_fnc_errorParamsType","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Displays a parameter type error message (using BIS_fnc_error) explaining the problem.","syntaxes":[{"syntax":"[value, method, expected] call BIS_fnc_errorParamsType","since":null,"effect":null,"exec":null,"params":[{"name":"value","type":"Anything","optional":true,"default":"nil","description":"value received.","types":["Anything"],"since":null,"text":"**value**: Anything - (Optional, default nil) value received."},{"name":"method","type":"String","optional":true,"default":"\"\"","description":"validation method, can be one of:\n- \"isEqualType\"\n- \"isEqualTypeArray\"\n- \"isEqualTypeAll\"\n- \"isEqualTypeAny\"\n- \"isEqualTypeParams\"","types":["String"],"since":null,"text":"**method**: String - (Optional, default \"\") validation method, can be one of:\n- \"isEqualType\"\n- \"isEqualTypeArray\"\n- \"isEqualTypeAll\"\n- \"isEqualTypeAny\"\n- \"isEqualTypeParams\""},{"name":"expected (Optional, default","type":"nil): Anything","optional":false,"default":null,"description":"expected type.","types":["nil","Anything"],"since":null,"text":"**expected** (Optional, default: nil): Anything - expected type."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"}}],"examples":[{"text":"```sqf\n// show error and abort if input is not of type ARRAY:\nif !(_this isEqualType []) exitWith { [_this, \"isEqualType\", []] call BIS_fnc_errorParamsType; };\n```","code":["// show error and abort if input is not of type ARRAY:\nif !(_this isEqualType []) exitWith { [_this, \"isEqualType\", []] call BIS_fnc_errorParamsType; };"]},{"text":"```sqf\n// 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; };\n```","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; };"]},{"text":"```sqf\n// 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; };\n```","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; };"]},{"text":"```sqf\n// show error and abort if input is neither ARRAY nor OBJECT:\nif !(_this isEqualTypeAny [[], objNull]) exitWith { [_this, \"isEqualTypeAny\", [[], objNull]] call BIS_fnc_errorParamsType; };\n```","code":["// show error and abort if input is neither ARRAY nor OBJECT:\nif !(_this isEqualTypeAny [[], objNull]) exitWith { [_this, \"isEqualTypeAny\", [[], objNull]] call BIS_fnc_errorParamsType; };"]},{"text":"```sqf\n// 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; };\n```","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; };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_error"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Diagnostic","Functions","Functions: Local Effect","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}