Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macro Statements

Expression Editor

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Sorting objects

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: April 17, 2021
Also available as a single HTML file

Onetastic Macro Documentation > Functions > Array Functions > Array_Merge

Array_Merge

Returns a new array that contains all the values in the given arrays. The values of each array are appended to the end of the previous one. If the arrays have the same string keys, then the later value for that key will overwrite the previous one. Numeric keys are not overwritten but instead will be appended. Values with numeric keys will be renumbered with incrementing keys starting from zero in the result array.

Syntax

Array Array_Merge(
	Array arrays...)

Parameters

Array arrays...
Arrays to merge. No arrays or several arrays can be provided.

Examples

$array = Array_Merge() // $array is an empty array $array = Array_Merge(Array(1, 2, 3), Array(7, 8, 9), Array(-2, -4, -5)) // $array is (1, 2, 3, 7, 8, 9, -2, -4, -5) $array1["size"] = "large" $array1["color"] = "red" $array2["size"] = "small" $array2["type"] = "t-shirt" $array3["color"] = "blue" $array3["price"] = 10 $array = Array_Merge($array1, $array2, $array3) // This creates the following array: // "size" => "small" // "color" => "blue" // "type" => "t-shirt" // "price" => 10

Reference

Statements

For

ForEach

If

Else If

Else

Switch

Case

Default

While

Expression

Comment

Break

Continue

Return

Hierarchy Objects

NotebookRoot

Notebook

SectionGroup

Section

Page

Page Objects

Title

Outline

Table

Column

Row

Cell

Paragraph

Text

Image

EmbeddedFile

Tag

Other Objects

DialogBox

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Object Functions

String Functions