Tag Link | [Array->Get] | Category | Array |
---|---|---|---|
Type | Member | Source Available | No |
Support | Preferred | Version | 5.0 |
Change | Unchanged | Data Source | Any |
Output Type | Any | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0 |
[Array->Get] returns an item from the array. Accepts a single integer parameter identifying the position of the item to be returned.
The first element in an array is at position 1.
This tag can be used as the left parameter of an assignment operator to set an element of the array.
An error will be returned if an item is requested which is greater than the size of the array.
[Array->(Get: Array Position)]
[Array->(Get: Array Position)=New Value]
Required Parameters | |
---|---|
Array Index | The index of the element from the array which should be returned. |
To return an element from an array:
Use the [Array->Get] tag to return an item from an array with a particular index. The following example returns the second item from an array of the days of the week.
[Variable: 'DaysOfWeek'=(Array:'Sun','Mon','Tue','Wed','Thu','Fri','Sat')]
[Output: $DaysOfWeek->(Get: 2)]
Mon