[set->find] searches the set for the parameter and returns a set element which matches. Accepts a single parameter of any data type including matchers. If no elements in the set match the parameter to the [set->find] method then the return value is void
This method is particularly useful when the set is a set of pairs, in which case the name of the name/value pair is compared to the search parameter.
set->find( search_term )
Use the [set->find] method. This example returns the pair whose "name" is 'Mon' from a set of day/person pairs.
Code
var( workSchedule = set('Mon' = 'Jono', 'Tues'='Sean', 'Wed'='Jess', 'Thur'='Eric', 'Fri' ='Jordon', 'Sat'='Jono','Sun'='Jono') )
var( aDay = $workSchedule->find('Mon') )
$aDay->second+' is working on Monday'
Result
Jono is working on Monday
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
Recent Comments