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

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: March 19, 2023
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(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

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

MacroMenu

Window

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

String Functions

Window Functions