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 > Concepts > Comments

Comments

You can provide comments between macro statements to improve readability of your macros. Comments are inserted using Comment statements :

// Create a new dialog box $dialog_box = DialogBox_Create("") // Now add some controls DialogBox_AddTextBox($dialog_box, "&Find what", $Search, "", false) DialogBox_AddTextBox($dialog_box, "&Replace with", $Replace, "", true) $Options = Array("Current page", "Current section", "Current notebook") DialogBox_AddDropDown($dialog_box, "&Scope", $Scope, "Current section", $Options) DialogBox_AddCheckBox($dialog_box, "Match &case", $MatchCase, false) // Now show the dialog box DialogBox_Show($dialog_box)

This helps with visually separating statements. Comments can also be used to temporarily remove statements from macro execution adding // in front of them (commenting-out):

// Create a new dialog box $dialog_box = DialogBox_Create("") // Now add some controls DialogBox_AddTextBox($dialog_box, "&Find what", $Search, "", false) DialogBox_AddTextBox($dialog_box, "&Replace with", $Replace, "", true) // For now we don't have following controls: // $Options = Array("Current page", "Current section", "Current notebook") // DialogBox_AddDropDown($dialog_box, "&Scope", $Scope, "Current section", $Options) // DialogBox_AddCheckBox($dialog_box, "Match &case", $MatchCase, false) // Now show the dialog box DialogBox_Show($dialog_box)

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