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 > Operators

Operators

Macro expressions can contain several different operators. They can be used for assignments, comparisons, arithmetic or logical operations and string concatenations. Following is a list of all the operators. Operators can be operating on one (unary), two (binary) or three (ternary) sub expressions:

Arithmetic Operators

OperatorNameType
+Additionbinary
Subtractionbinary
*Multiplicationbinary
/Divisionbinary
%Modulobinary
Unary Minusunary
+Unary Plusunary
 

Increment/Decrement Operators

OperatorNameType
++$vPre-Incrementunary
––$vPre-Decrementunary
$v++Post-Incrementunary
$v––Post-Decrementunary
 

Assignment Operators

OperatorNameType
=Assignmentbinary
+=Addition Assignmentbinary
–=Subtraction Assignmentbinary
*=Multiplication Assignmentbinary
/=Division Assignmentbinary
%=Modulo Assignmentbinary
&&=Logical And Assignmentbinary
||=Logical Or Assignmentbinary
&=Concatenation Assignmentbinary
 

Comparison Operators

OperatorNameType
==Equalsbinary
!=Not Equalsbinary
<Less Thanbinary
<=Less Than or Equalsbinary
>Greater Thanbinary
>=Greater Than or Equalsbinary
 

Logical Operators

OperatorNameType
&&Logical Andbinary
||Logical Orbinary
!Logical Notunary
 

String Concatenation Operator

OperatorNameType
&Concatenationbinary
 

Ternary Operator

OperatorNameType
?:Ternary Operatorternary

Operator Precedence

In macro expressions, following operator precedence rules apply. The order of operations can be changed by providing parantheses.

PrecedenceCategoryOperators
1Increment/Decrement++––
2Unary!+
3Product*/%
4Sum & Concatenation+&
5Comparison==!=<<=>>=
6Logical And&&
7Logical Or||
8Ternary?:
9Assignment=+=–=*=/=%=&&=||=&=
Note: Assignments are evaluated right to left

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