Lasso Soft Inc. > Home

[Map->Find]

[Map->Find] returns the value for the key that matches the parameter. Accepts a single parameter of any data type.

If no keys in the map match the parameter to the [Map->Find] tag then Null is returned.

  • Syntax
  • Parameters
[Map->(Find: 'Key Value')]
Required Parameters
Map The map which is to be operated upon.
Key Value The key for which a value stored in the map should be returned.
Examples

To fetch a value from a map for a given key:

Use the [Map->Find] tag. The following example retrieves the value for the key 'blue' from a map of color names to HTML color codes.

<?LassoScript
  Variable: 'Colors'=(Map: 'red'='#ff0000', 
    'green'='#00ff00', 
    'blue'='#0000ff');
  Output: $Colors->(Find: 'blue');
?>
Result:
#0000ff
Tag Link [Map->Find] 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. > Home

 

 

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