Lasso Soft Inc. > Home

Pair

A pair is an object that holds two values. Pairs are often used to represent name/value pairs so the first element is often referred to as the name and the second element is referred to as the value.

Pairs can be used to hold any data type including decimals, integers, strings, maps, arrays, other pairs, etc.

Pairs are returned by many LDML tags. The [Action_Params] tag returns an array of pairs representing the parameters of the current Lasso action. The [Map->Get] tag always returns a pair representing the key and value of a particular map element.

A pair can be created explicitly using the [Pair] tag. An empty pair can be created using [Pair] as in [Variable: 'myPair' = (Pair)] or the elements of the new pair can be set explicitly as in [Variable: 'myPair' = (Pair: 'first'='second')].

Pairs are created implicitly when defining or inserting elements into arrays. [Variable: 'myArray' = (Array: 1='one')] will create an array containing one pair. [$myArray->(Insert: 2='two')] will insert a pair into the array.

See the descriptions of the pair member tags [Pair-First] and [Pair->Second] for examples of how to retrieve pair elements or set them.

  • Syntax
  • Parameters
[Variable: 'myPair' = (Pair)]

[Variable: 'myPair' = (Pair: 'name'='value')]
Examples

See the Lasso 8 Language Guide for examples of how to use this tag.

Tag Link Pair Category Data Type
Type Data Type Data Source Any
Support Preferred Version 5.0
Output Type Security
Implementation Internal Sets Lasso 6.0, Lasso 5.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 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft