use the List function
use {  } curly braces
Use the List() function or curly braces to create a list that includes numbers and variables:
When you add the Eval function:
In a loop, you need the Eval function in the nested loop to evaluate the variable’s contents. For example:
mylist = {1, log(2), e()^pi(), height[40]}; // stores the expressions
List a contains four items.
Multiple left-side subscripts (for example, a[i][j] = value where a contains a list of things that are subscriptable) are allowed in the following circumstances:
Each level except the outermost level must be a list. So, in the example above, a must be a list but a[i] can be anything subscriptable.
Each subscript except the last must be a number. So, in the example above, i must be a number, but j could be a matrix or list of indices.
Use the Loc() function or the Contains() function to find values in a list:
Loc() and Contains() return the positions of the values. Loc() returns the results in a matrix, and Contains() returns the results as a number.
The Loc function returns each occurrence of a repeated value. Contains() returns only the first occurrence of a repeated value.
If the value is not found, the Loc function returns an empty matrix and Contains() returns a zero.
To assess whether an item is in a list, use Loc() and Contains() with >0. A returned value of zero means that the item is not in the list. A returned value of 1 means that the item is in the list at least once.
Search for the value "Katie" in the nameList:
Search for the value "Erin" in the nameList:
Search for the number 8 in the numList:
Find out if the number 5 exists in the numList:
List Operators describes the list operators and their syntax.
As List(matrix)
{list} = {list}
{list} += value
{list} -= {list}
JMP does not have a pre-decrement operator. Use the SubtractTo() operator instead (-=).
Concat To(list1, list2, ...)
Concat(list1, list2, ...);
Insert Into(list, x, <i>)
Inserts a new item (x) into the list at the given position (i). If i is not given, the item is added to the end of the list. This function does change the original list.
list = Insert(list, x, <i>)
Returns a copy of the list with a new item (x) inserted into the list at the given position (i). If i is not given, the item is added to the end of the list. This function does not change the original list.
Returns true (1) if arg is a classical list (in other words, one that would result from the construction by List(items) or {items}) and returns false (0) otherwise. An empty list is still a list, so IsList({ }) returns true. If miss=., then IsList(miss) returns false, not missing.
List(a, b, c)
{a, b, c}
Returns the number of elements in the list specified. Can be assigned to a variable.
Remove From(list, <i>, <n>)
Deletes n items from the list, starting from the indicated position (i). If n is omitted, the item at i is deleted. If n and i are omitted, the item at the end is removed. This function does change the original list.
Remove(list, <i>, <n>)
Returns a copy of the list with the n items deleted, starting from the indicated position (i). If n is omitted, the item at i is deleted. If n and i are omitted, the item at the end is removed. This function does not change the original list.
Reverses the order of the items in the list. This function does change the original list.
Returns a copy of the list with the items in reverse order. This function does not change the original list.
Shift Into(list, <n>)
Shifts n items from the front of the list to the end of the list. If n is omitted, the first item is moved to the end of the list. This function does change the original list.
Shift(list, <n>)
Returns a copy of the list with n items shifted from the front of the list to the end of the list. If n is omitted, the first item is moved to the end of the list. This function does not change the original list.
Returns a copy of the list sorted in ascending order. This function does not change the original list.
Returns a copy of the list sorted in descending order. This function does not change the original list.
Sorts the list in ascending order. This function does change the original list.
Returns a copy of the list sorted in ascending order. This function does not change the original list.
list[i]
x = list[i]
list[i] = value
a[b, c]
Subscript(a, b, c)
Subscripts for lists extract the ith item from the list. Subscripts can in turn be lists or matrices.
Substitute(list, pattExpr1, replExpr1, ...)
Substitute Into(list, pattExpr1, replExpr1, ...)
You can use Loc() to locate the items in the new list that are equal to 25:
Join two or more lists into one list with Concat() or the || operator.
The following example uses Concat() to join lists a and b: