Add - Array

From Creation Kit
Jump to: navigation, search

Member of: All Arrays

Adds a new item to the array at the end, expanding it to fit. May add multiple items at once.

Syntax

Function Add(;/element type/; akElement, int aiCount = 1) native

Parameters

  • akElement: The element to locate
  • aiCount: The number of items to add
    • Default: 1

Return Value

None

Examples

; Add the number 4 to the end of the array
MyIntArray.Add(4)


; Add the number 1 four times into the array
MyIntArray.Add(1, 4)

Notes

If you add a struct to an array it will only be a single struct, not multiple copies of the struct. Add essentially works like a while loop, continually adding the thing you give it to the array, after saving that thing off into a variable.

See Also