BIS fnc param: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Define script parameter. |= Description
| Load a script parameter. See [[Functions_Library_(Arma_3)#Loading_Parameters|Functions_Library_(Arma_3)]] for detailed description. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 09:47, 5 August 2013

Hover & click on the images for description

Description

Description:
Load a script parameter. See Functions_Library_(Arma_3) for detailed description.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[input,index,(defaultValue,dataTypes,requiredCount)] call bis_fnc_param;
Parameters:
input: Array - list of params
index: Number - selected index
defaultValue (Optional): Anything - default param (used when param is missing or of wrong type). You can overload default value by setting 'BIS_fnc_<functionName>_<index>'
dataTypes (Optional): Array - list of allowed type examples (e.g. ["",[],0,objnull])
requiredCount (Optional): Number - If value is Array, checks if it has required number of elements
Return Value:
Anything

Examples

Example 1:
_target = [_this, 0, objNull, [objNull,[]], [2,3]] call bis_fnc_param;
  • If (_this select 0) is not defined, default objnull is used.
  • If (_this select 0) is defined, but is neither of type Object nor Array, error message is logged and default objNull is used.
  • If (_this select 0) and is Array, but it's count is neither 2 nor 3, error message is logged and default objNull is used.
Example 2:
_answer = [_this, 1, 42] call bis_fnc_param;
  • If (_this select 1) is not defined, default 42 is used.
  • No limit for data types or number of elements exists.
  • Additional Information

    See also:
    See also needed

    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

    Notes

    Bottom Section