Lasso Soft Inc. > Home

[ staticarray->+ ]

Method

Concatenates two staticarrays together into a new array without affecting the originals. The combined array preserves the order of the elements of the contributing arrays.

Also provides the ability to append an element of any data type to the staticarray

  • Syntax
staticarray + element
Examples
  • Beginner

Append the elements of one static array to another

This example combines arrays of french and english days of the week into a new array

Code

var( DaysOfWeek = staticarray('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'),
     JoursDuSemaine = staticarray('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam') )

var( combinedDays = $DaysOfWeek + $JoursDuSemaine )
$combinedDays

Result

staticarray(Sun, Mon, Tue, Wed, Thu, Fri, Sat, Dim, Lun, Mar, Mer, Jeu, Ven, Sam)

Append an object to the end of a staticarray

This example show how to add a pair to the end of a staticarray of days of the week

Code

var( DaysOfWeek = staticarray('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') )

var( combinedDays = $DaysOfWeek + pair('Sun' = 'Dim'))
$combinedDays

Result

staticarray(Sun, Mon, Tue, Wed, Thu, Fri, Sat, (Sun = Dim))

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 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft