Lasso Soft Inc. > Home

[Array->Merge]

[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.

  • Syntax
  • Parameters
[Array->(Merge: Merge Array)]

[Array->(Merge: Merge ArrayArray Index)]

[Array->(Merge: Merge ArrayArray IndexMerge Index)]

[Array->(Merge: Merge ArrayArray IndexMerge IndexMerge Length)]
Required Parameters
Array The base array.
Merge Array The array which should be merged onto the end of the base array.
Examples

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.

<?LassoScript
  Variable: 'DaysOfWeek'=(Array: 'Sun', 'Mon', 'Tue', 'Wed');
  Variable: 'MoreDays'=(Array: 'Thu', 'Fri', 'Sat');
  $DaysOfWeek->(Merge: $MoreDays);
  Output: $DaysOfWeek;
?>
Result:
(Array: (Sun), (Mon), (Tue), (Wed), (Thu), (Fri), (Sat))
Tag Link [Array->Merge] Category Array
Type Member Data Source Any
Support Preferred Version 5.0
Output Type None Security None
Implementation LCAPI Sets Lasso 7.0, Lasso 6.0, Lasso 5.0

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