Lasso Soft Inc. > Home

[ set->remove ]

Method

The [set->remove] removes one element from a set.

The method requires one parameter which is either the element to be removed or, if the element is a name/value pair, the "name" of the pair. The set is modified in place and no result is returned.

  • Syntax
set->remove( element )
Examples
  • Beginner

Remove an element of a set

Use the [set->remove] method. This example removes the weekend days from a set of pairs.

Code

var( workSchedule = set('Mon' = 'Jono', 
                        'Tues'='Sean', 
                        'Wed'='Jess', 
                        'Thur'='Eric',
                        'Fri' ='Jordon', 
                        'Sat'='Jono',
                        'Sun'='Jono') )

$workSchedule->remove('Sat')
$workSchedule->remove('Sun')

$workSchedule

Result

set((Fri = Jordon), (Mon = Jono), (Thur = Eric), (Tues = Sean), (Wed = Jess))

Recent Comments

No Comments found

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