Skip to content
Julius Paffrath edited this page Jul 2, 2026 · 8 revisions

Introduction

Lists are a very powerful kind of variable and can store any type of data. Creating a list is easy:

set myList to list()

Creating a new list with elements is easy as well:

set myFruits to list("Apple", "Orange", "Banana")

If you add an element to a list, it will be appended at the end of the list:

set myFruits to listAdd(myFruits, "Cherry")

As you can see, all list functions are returning copies, so you have to store the result.

Complete reference with named parameters

list(param1:any, param2:any, ...)

Returns a new list containing the given elements. Please note that list() does not support named parameters.

listSize(list: list)

Returns the size of the given list.

listAdd(list: list, element: any)

Adds the given element to a copy of the given list and returns the copy.

listGet(list: list, index: number)

Returns the element at the given index.

listGetRange(list: list, indexStart: number, indexEnd: number)

Returns the elements in the given range.

listSet(list: list, index: number, element: any)

Sets an element at the given index to a copy of the given list and returns the copy.

listRemove(list: list, index: number)

Removes the element at the given index in a copy of the given list and returns the copy.

listReverse(list: list)

Reverses the elements in the list.

listExtend(list: list, expander: list)

Creates a copy of the given list expanded with the expander and returns the copy.

Clone this wiki locally