Carrot reference
...
Fields
Data Types

List

A List of a number of objects, in order.

This datatype is often used to represent concepts such as a list of Groups, a list of StockGrants, etc.

Properties

Property

Type

Description

first

Object

The first object in the sequence

last

Object

The last object in the sequence

length

Number

The number of entries contained in the Sequence

reversed

Sequence

The sequence, in reverse order

Indexing by Position

You can return each item of the list using list[index] syntax, starting numbering with 0 to represent the first item of the list.

  • For example, myList[2] will return the third element in the list.

Representing Lists

To represent a List in an expression, you can use [square brackets] with commas to separate the elements.

  • For example: [1, 2, 3] will represent a List containing the numbers 1, 2, and 3.
  • ["Director", "VP"] will represent a List containing the Strings "Director" and "VP"

List and Equality Comparisons

The = (equals) operator will test for list membership when comparing a singular value to a list.

  • For example, ["Director", "VP"] = "vp" will return true, because "VP" (case-insensitive) is a member of the list.