The [staticarray->join] method may be used in three distinct ways.
staticarray->join('string')
staticarray->join(number_of_copies, element)
staticarray->join( other_array )
Use the [staticarray->join] method with a supplied delemiter.
This example outputs a comma separated list of days of the week.
Code
var( daysOfWeek = staticarray( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') )
var (daysList = $daysOfWeek->join( ', ' ) )
$daysList+ '\n'
'daysList has type '+$daysList->type
Result
Sun, Mon, Tue, Wed, Thu, Fri, Sat daysList has type string
Use the [staticarray->join] method with an integer value (number of copies) and the element you wish to add as parameters.
This example adds the element 'Sun' to the end of an array of days of the week 3 times.
Code
var( daysOfWeek = staticarray( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') )
var (daysList = $daysOfWeek->join(3, 'Sun') )
$daysList+ '\n'
'daysList has type '+$daysList->type
Result
staticarray(Sun, Mon, Tue, Wed, Thu, Fri, Sat, Sun, Sun, Sun) daysList has type staticarray
Use the [staticarray->join] method with a staticarray as the parameter.
This example ads the elements of an array of french days of the week to the end of an array of english days of the week
Code
var( daysOfWeek = staticarray( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'),
joursDuSemaine = staticarray( 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam') )
var (daysList = $daysOfWeek->join($joursDuSemaine))
$daysList+ '\n'
'daysList has type '+$daysList->type
Result
staticarray(Sun, Mon, Tue, Wed, Thu, Fri, Sat, Dim, Lun, Mar, Mer, Jeu, Ven, Sam) daysList has type staticarray
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