Ar Range

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender.

Description

Returns a regular array (list) containing all int values between the specified start and end (inclusive), at the specified step interval. The step argument is optional and defaults to 1. A negative step interval can be used to order elements in reverse.

To assign the function return to a variable, the let command must be used, rather than 'set'.

Syntax

[help]
(array) Ar_Range Start:int End:int step:int 

Example

array_var arr

let arr := Ar_Range 1, 5

 ; arr contains: 1, 2, 3, 4, 5

let arr := Ar_Range 0, 30, 10

 ; arr contains: 0, 10, 20, 30

let arr := Ar_range 10, 5, -1

 ; arr contain: 10, 9, 8, 7, 6, 5

See Also