Tag Link | [Pair->Get] | Category | Array |
---|---|---|---|
Type | Member | Source Available | No |
Support | Preferred | Version | 6.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 |
[Pair->Get] returns either the first or second elements of a pair. This tag is equivalent to using [Pair->First] or [Pair->Second].
[Pair->Get] and [Pair->Size] ensure that the [Iterate] ... [/Iterate] tags function on pairs as well as on maps, arrays, and strings.
[Pair->(Get: 1)]
[Pair->(Get: 2)
Required Parameters | |
---|---|
Index | The index (1 or 2) of the element to fetch. |
To get each element of a pair:
Use the [Pair->Get] tag. Since the size of a pair is always 2 this tag only works with an index of 1 or 2. The following example loops through the elements of a pair using the [Pair
[Variable: 'myPair' = (Pair: 'First'='Second')]
[Loop: $myPair->Size]
<br>[Loop_Count]: [Output: $myPair->(Get: Loop_Count)]
[/Loop]
<br>First
<br>Second