BIS_fnc_errorParamsType

From Bohemia Interactive Community
Revision as of 12:16, 13 July 2022 by Lou Montana (talk | contribs) (Text replacement - "<code>([^<]*)\[\[[^|]+\| *([a-zA-Z= _]+) *\]\]([^<]*)<\/code>" to "<code>$1$2$3</code>")
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Displays a parameter type error message (using BIS_fnc_error) explaining the problem.
Execution:
call
Groups:
Diagnostic

Syntax

Syntax:
[value, method, expected] call BIS_fnc_errorParamsType
Parameters:
value (Optional, default: nil): Anything - Value received.
method (Optional, default: ""): String - Validation method, can be one of:
  • "isEqualType"
  • "isEqualTypeArray"
  • "isEqualTypeAll"
  • "isEqualTypeAny"
  • "isEqualTypeParams"
expected (Optional, default: nil): Anything - Expected type.
Return Value:
Nothing

Examples

Example 1:
// Show error and abort if input is not of type ARRAY: _this _this, "isEqualType", []] call BIS_fnc_errorParamsType; };
Example 2:
// Show error and abort if array input is not in format [SCALAR, STRING, BOOL]: _this _this, "isEqualTypeArray", [0, "", true]] call BIS_fnc_errorParamsType; };
Example 3:
// Show error and abort if array input is not in format [BOOL, BOOL, BOOL, ...]: _this _this, "isEqualTypeAll", true] call BIS_fnc_errorParamsType; };
Example 4:
// Show error and abort if input is neither ARRAY nor OBJECT: _this _this, "isEqualTypeAny", [[], objNull]] call BIS_fnc_errorParamsType; };
Example 5:
// Show error and abort if input is neither of type ARRAY nor array in format [SCALAR, ARRAY, <ANYTHING>, OBJECT]: if !(_this isEqualTypeParams [0, [], nil, objNull]) exitWith { [_this, "isEqualTypeParams", [0, [], nil, objNull]] call BIS_fnc_errorParamsType; };

Additional Information

See also:
BIS_fnc_error

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