Introduced in

Version:1.20

Description

Description:Returns a sub-selection of the passed array.

Syntax

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

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_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

See also: fn vbs selectRelative
Multiplayer: 
Problems: 

Notes