Difference between revisions of "Ar InsertRange"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Odessa
(Created page with "{{Function |origin = NVSE |summary = Similar to Ar_Insert, but allows for multiple new elements to be inserted at once. Inserts a range of elements into an Array-type ar...")
 
imported>Odessa
(syntax error)
 
Line 28: Line 28:
let MyInsertion := Ar_List Beer, Jet, Knife
let MyInsertion := Ar_List Beer, Jet, Knife


Ar_Insert MyList, 1, MyInsertion
Ar_InsertRange MyList, 1, MyInsertion


; * MyList now contains: SunnyREF, Beer, Jet, Knife, CheyenneREF
; * MyList now contains: SunnyREF, Beer, Jet, Knife, CheyenneREF

Latest revision as of 14:49, 2 July 2014

< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Similar to Ar_Insert, but allows for multiple new elements to be inserted at once. Inserts a range of elements into an Array-type array (list) at the specified index, provided the index is not greater than the current size of the array.

Elements above the insertion index are shifted up by the number of elements inserted. The range is itself passed as an Array, and each element of the range is inserted into the target Array in order.

Usable only with Array-type (regular/list) arrays. Note that this function modifies an array in place and returns a boolean, not a new array.

Syntax

[help]
(bool) Ar_InsertRange Array:array Index:int ToInsert:array

Example

array_var MyList
array_var MyInsertion

let MyList := Ar_List SunnyREF, CheyenneREF

let MyInsertion := Ar_List Beer, Jet, Knife

Ar_InsertRange MyList, 1, MyInsertion

; * MyList now contains: SunnyREF, Beer, Jet, Knife, CheyenneREF

See Also