Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: September 02, 2024
Also available as a single HTML file

Onetastic Macro Documentation > Functions > Array Functions > Array_Reverse

Array_Reverse

Reverses the order of elements in the given array.

Syntax

void Array_Reverse(
	byref Array array, 
	Bool preserveKeys)

Parameters

Array array
Array to reverse.
Bool preserveKeys
If true, the values in the array will have the same keys as before, but just order changed. If false, the values will be assigned to new numeric keys starting from zero.

Examples

$array = Array(2, 4, 6, 8, 10) Array_Reverse($array, false) // $array is now: // 0 => 10 // 1 => 8 // 2 => 6 // 3 => 4 // 4 => 2 // You can choose to preserve keys: $array1 = Array(2, 4, 6, 8, 10) Array_Reverse($array1, true) // $array1 is now: // 4 => 10 // 3 => 8 // 2 => 6 // 1 => 4 // 0 => 2

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions