LassoScript Utility
Basics Browse Detail


Tag Link [Array->Merge] Category Array
Type Member Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0


[Array->Merge] merges an array parameter into the array. Accepts an array parameter and three integer parameters that identify which items from the array parameter should be inserted into the array. Defaults to inserting the entire array parameter at the end of the array. Returns no value.

The first element in an array is at index 1. An error is returned if any of the indexes specified are beyond the size of the arrays.

The first integer parameter specifies at which index in the base array the merge array should be inserted. Defaults to the end of the base array.

The second integer parameter specifies an offset into the merge array. Elements after this merge index will be copied into the base array. By default, the entire merge array will be copied.

The third integer parameter specifies the number of elements from the merge array which should be copied. By default all elements in the merge array after the merge index will be copied.


[Array->(MergeMerge Array)]

[Array->(MergeMerge ArrayArray Index)]

[Array->(MergeMerge ArrayArray IndexMerge Index)]

[Array->(MergeMerge ArrayArray IndexMerge IndexMerge Length)]


Required Parameters
Merge Array The array which should be merged onto the end of the base array.
Optional Parameters
Array index The index at which to insert the merge array in the base array. By default the merge array is inserted at the end of the base array.
Merge Index The index into the merge array at which to start copying elements. By default, the entire merge array is copied.
Merge Length The number of elements to copy from the merge array. By default, the entire merge array after the merge index is copied.


To merge two arrays:

Use the [Array->Merge] tag. The following example merges two arrays, each of which contains a portion of the days of the week. The resulting array is output.

  Variable: 'DaysOfWeek'=(Array: 'Sun', 'Mon', 'Tue', 'Wed');
  Variable: 'MoreDays'=(Array: 'Thu', 'Fri', 'Sat');
  $DaysOfWeek->(Merge: $MoreDays);
  Output: $DaysOfWeek;

(Array: (Sun), (Mon), (Tue), (Wed), (Thu), (Fri), (Sat))

Related Tags

Category Tags