fn vbs subSelect (VBS2)

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Virtual Battlespace 2 version 1.20

Click on the images for descriptions

Introduced in

Game:
Virtual Battlespace 2
Version:
1.20

Description

Description:
Returns a sub-selection of the passed array. There are various methods the sub-array can be determined.

Syntax

Syntax:
[array, beg, end] call fn_vbs_subSelect
Parameters:
array: Array - Array to select sub array from.
beg: Number - Index of array to begin sub-array. If negative, index is counted from the end of array.
end: Number - Optional. Index of array to end the sub-array. If ommitted, remainder of the array will be selected. If negative, it specifies the length of the sub-array (in absolute form).
Return Value:
Array

Examples

Example 1:
_array = ["a","b",true,3,8];
[_array, 2] call fn_vbs_subSelect; //returns [true,3,8]
[_array, -2] call fn_vbs_subSelect; //returns [3,8]
[_array, 1, 3] call fn_vbs_subSelect; //returns ["b",true,3]
[_array, 1, -2] call fn_vbs_subSelect; //returns ["b",true]

Additional Information

Multiplayer:
Behaviour unknown.
See also:
fn_vbs_selectRelative

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

Bottom Section

Personal tools
Buy ArmA now!