ARRAY::APPEND 1g 2024-03-19 laplante@plcb.ca GOWEB/ARRAY — Append Elements to an Array


title: “ARRAY::APPEND” version: “1g” date: 2024-03-19 author: “laplante@plcb.ca”

category: “GOWEB/ARRAY”

Name

array::append Append Elements to an Array

Synopsis

**array::append**(array[, error: variable, value...])
**append**(array[, error: variable, value...])

Description

The append function adds one or more values to the end of an array, increasing its size.
It returns a new array with the appended elements.

If error is provided, any operation error will be stored in that variable instead of causing an immediate failure.


Examples

res={{
    a := [1,2,3];
    b := append(a, 4, 5, 6);
    a; "\n";
    b; "\n";
}}.

Returns:

[1,2,3]
[1,2,3,4,5,6]

Author

laplante@plcb.ca


See Also


Version