Lasso Soft Inc. > Home

[Array->Find]

[Array->Find] returns an array of elements that match the parameter. Accepts a single parameter of any data type.

If the array contains any pair values, only the first part of the pair is compared with the parameter of the [Array->Find] tag.

If no elements in the array match the parameter to the [Array->Find] tag then an empty array is returned.

  • Syntax
  • Parameters
[Array->(Find: 'Find Value')]
Required Parameters
Array The array which should be searched.
Find Value The value which should be searched for in the array.
Examples

To find an element in an array of pairs:

Use the [Array->Find] tag with the value of the first element of the pairs that should be returned from the array. The following example shows an array of pairs returned from the tag, each of which has a first element of 'John Doe'.

[Var: 'People_Array'=(Array: 'John Doe'='Person One', 'Jane Doe'='Person Two', 'Joe Surname'='Person Three', 'John Doe'='Person Four')]
[Output: $People_Array->(Find: 'John Doe')]
Result:
(Array: (Pair: (John Doe)=(Person One), (John Doe)=(Person Four)))
Tag Link [Array->Find] Category Array
Type Member Data Source Any
Support Preferred Version 5.0
Output Type Array 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