System information
Manual:Scripting
27
This
is
a
test
Operators
Arithmetic Operators
Usual arithmetic operators are supported in RouterOS scripting language
Opearator Description Example
"+" binary addition :put (3+4);
"-" binary subtraction :put (1-6);
"*" binary multiplication :put (4*5);
"/" binary division :put (10 / 2); :put ((10)/2)
"-" unary negation { :local a 1; :put (-a); }
Note: for division to work you have to use braces or spaces around dividend so it is not mistaken as IP
address
Relational Operators
Opearator Description Example
"<" less :put (3<4);
">" greater :put (3>4);
"=" equal :put (2=2);
"<=" less or equal
">=" greater or equal
"!=" not equal
Logical Operators