Go to documentation repository
Documentation for Intellect 4.10.4. Documentation for other versions of Intellect is available too.
Previous page Next page
The table below lists and describes comparison, arithmetic and conditional operators.
Operator | General description, example use |
Comparison operators | |
> | Comparison operator – greater. See example in Description of operators section. |
< | Comparison operator – greater. See example in Description of operators section. |
Arithmetic operators | |
+ | Addition. Example use: OnEvent ("MACRO","1","RUN") { x=5; y=10; i=x+y; // add strings, i.e. 5+10=510 e=str(x+y); // add integers 5+10=15 } |
- | Subtraction. Example use: OnEvent ("MACRO","1","RUN") { x=5; y=10; i=x-y; // subtract integers 5-10=-5 e=str(x-y); // subtract integers 5-10=-5 } |
* | Multiplication. Example use: OnEvent ("MACRO","1","RUN") { x=5; y=10; i=x*y; // multiply integers 5*10=50 e=str(x*y); // multiply integers 5*10=50 } |
/ | Division. Example use: OnEvent ("MACRO","1","RUN") { x=5; y=10; i=x/y; // divide integers 5/10=0.5 e=str(x/y); // divide integers 5/10=0.5 } |
% | Remainder after integer division. Example use. OnEvent ("MACRO","1","RUN") { a=1120.0; b=100; e=a%b; // remainder after integer division, i.e 1100 is divided by 100 and 20 is remainder. // if there is division without remainder, then result is 0 } |
( ) | Group of arithmetic operators. Example use. OnEvent ("MACRO","1","RUN") { x=100/((5*8)/1.028); } |
Logical operators | |
&& | Logical AND operator. Example use: OnEvent ("MACRO","1","RUN") { a=1; b=2; z=3; if((a<b)&&(b<z)) { y=1; //if false, then else } else { x=0; } } |
! | Logical inversion operator. Example use: OnEvent ("CAM",N,"MD_START") { if(!(strequal(N,"1",))) { DoReact("GRELE","1",""ON) } else { DoReact("GRELE","2",""ON) } } |
Overview
Content Tools