List
The List Data Type is used to group together values in a specific order. The syntax for creating a List is to enclose a set of values inside square brackets, separating the values by a comma - like Arrays in other languages. For example, to create a list with the numbers 1, 2, and 3 write the following Airscript Expression:
Once grouped, the values can be accessed by their numeric index. The indices begin at zero, so the first value is located at index 0. If the list in the previous example were stored in a variable named my_list
we would write the following Airscript Expression to access the first value (number 1).
Any Expression that results in a Number can be used. Perhaps there is a variable offset
that holds a Number that is meant to index my_list. In order to retrieve the value at that index we would write the following Airscript.
If the provided index is greater than, or equal to, length of the list, the result will be NULL. Using my_list
the following Expression will result in NULL:
Other notes:
In Airscript, there are no direct equavilent .push
or .append
methods available. To achieve the same result, use the FLAT method:
Last updated