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_FromRange

Array_FromRange

Creates an array containing a range of numeric values. This can be used to run a For loop on a sequence of numbers. For instance ForEach ($i in Array_FromRange(1, 10, 1)) will iterate over numbers 1 to 10.

Syntax

void Array_FromRange(
	Numeric start, 
	Numeric end, 
	Numeric step)

Parameters

Numeric start
The first value in the array.
Numeric end
The last value in the array.
Numeric step
The value to use as the increment between elements in the sequence. Can be positive for an increasing sequence or negative for a decreasing sequence. The value of end must be reachable by repeatedly incrementing start with step.

Examples

$array = Array_FromRange(1, 10, 1) // This is the same as $array = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) $array = Array_FromRange(10, 1, -2) // This is the same as $array = Array(10, 8, 6, 4, 2)

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