Lasso Soft Inc. > Home

[Pair->Get]

[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.

  • Syntax
  • Parameters
[Pair->(Get: 1)]

[Pair->(Get: 2)
Examples

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-Size] tag (which returns 2) and the [Pair->Get] tag.

[Variable: 'myPair' = (Pair: 'First'='Second')]
[Loop: $myPair->Size]
  <br>[Loop_Count]: [Output: $myPair->(Get: Loop_Count)]
[/Loop]
Result:
<br>First <br>Second
Tag Link [Pair->Get] Category Array
Type Member Data Source Any
Support Preferred Version 6.0
Output Type Any Security None
Implementation Internal Sets Lasso 6.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft