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_PopFront

Array_PopFront

Removes and returns the first element in the array. All numerical keys in the array will be modified to start counting from zero while string keys won't be affected. To use an array as a queue, use this function along with Array_PushBack.

Syntax

Mixed Array_PopFront(byref Array array)

Parameters

Array array
Array to remove and return the the first element from.

Examples

$array = Array(6, 4, 8, 10, 12) $firstElement = Array_PopFront($array) $secondElement = Array_PopFront($array) // $array is now (8, 10, 12) // $firstElement is 6 // $secondElement is 4 // Numeric keys will reset to start from 0 $array3[5] = 10 $array3[7] = 12 $array3[9] = 14 Array_PopFront($array3) // $array3 is now: // 0 => 12 // 1 => 14 Array_PopFront($array3) // $array3 is now: // 0 => 14 // String keys are not affected: $array4[7] = "a" $array4[-2] = "b" $array4["size"] = "large" $array4["color"] = "red" Array_PopFront($array4) // $array4 is now: // 0 => "b" // "size" => "large" // "color" => "red" Array_PopFront($array4) // $array4 is now: // "size" => "large" // "color" => "red"

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