Skip to main content
Skip table of contents

concatArrays() Operation

Concatenates the elements of one or more arrays to a target array.

Syntax

anArray.concatArrays(anotherArray_1, ..., anotherArray_n)

Semantics

Concatenates the elements of one or more arrays to the elements of anArray. All arrays must have the same array element type.

  • The arrays to be concatenated cannot be NULL.

  • If an array has NULL elements, these will be preserved after concatenation.

Substitutables

anArray, anotherArray

Can be any variable or object attribute having the type Array. The arrays must not be NULL.

Error Codes

Find the related error codes on System Errors.

BESM/2

One of the parameters of a vararg function returned NULL.
This error occurs if one of the arrays is NULL.

Examples

Input: an array of customers and an array of prospects

JSON
{ "customers": [
    {"company": "Summer Ltd.", "name": "Adam Sun"},
    {"company": "Summer Ltd.", "name": "Barbara Beaches"},
    {"company": "Winter & Partners", "name": "John Snow"}
]}
JSON
{ "prospects": [
    {"company": "Spring Corp.", "name": "Rose Bloom"},
    {"company": null, "name": null},
    {"company": "Summer Ltd.", "name": "Cloe Cloud"}
]}
CODE
set resultArray = customers.concatArrays(prospects);

A new array resultArray is created containing all references to elements of the listed arrays.

JSON
{ "resultArray": [
    {"company": "Summer Ltd.", "name": "Adam Sun"},
    {"company": "Summer Ltd.", "name": "Barbara Beaches"},
    {"company": "Winter & Partners", "name": "John Snow"},
    {"company": "Spring Corp.", "name": "Rose Bloom"},
    {"company": null, "name": null},
    {"company": "Summer Ltd.", "name": "Cloe Cloud"}    
]}

The NULL values of the prospect array are preserved.

Note that the resultArray contains object references to the array elements of customers and prospects. Refer to Object References to get a better understanding of the effects.

ActionScript_ArrayOperations_Example

Click here to download a simple example model that shows how to use Action Script to handle arrays with Scheer PAS Designer.

Related Content

Related Pages:

  • Object References
    The Designer uses references for all objects. This page explains the concept and implications of object references.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.