[Map->Get] returns a key/value pair from the map. Accepts a single integer parameter identifying the position of the item to be returned.
The first element in a map is at position 1. The elements in a map are ordered arbitrarily. The order may change as elements are added and removed from the map.
An error will be returned if an item is requested which is greater than the size of the map.
[Map->(Get: Map Position)]
Use the [Map->Get] tag. This tag treats the map as if it were an array. The following code loops through the map displaying each value.
<?LassoScript
Variable: 'Colors'=(Map: 'red'='#ff0000',
'green'='#00ff00',
'blue'='#0000ff');
Loop: $Colors->Size;
Output: '<br>' + $Colors->(Get: Loop_Count), -EncodeNone;
/Loop;
?>
<br>(Pair: (red), (#ff0000))
<br>(Pair: (green), (#00ff00))
<br>(Pair: (blue), (#0000ff))
Tag Link | [Map->Get] | Category | Array |
---|---|---|---|
Type | Member | Data Source | Any |
Support | Preferred | Version | 5.0 |
Output Type | Any | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, 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 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft