Difference between revisions of "%op"
From Zenitel Wiki
(→Example) |
|||
Line 1: | Line 1: | ||
+ | {{A}} | ||
%OP( , , ) : [[Event_Handler]] macro for numeric calculations. | %OP( , , ) : [[Event_Handler]] macro for numeric calculations. | ||
Revision as of 08:54, 11 January 2017
%OP( , , ) : Event_Handler macro for numeric calculations.
Format: %OP(integer1,operator,integer2)
- no space is allowed between ',' and the operator.
- The operator can be one of:
+ | add |
- | subtract |
* | multiply |
/ | divide |
< | less |
<= | less or equal |
> | greater |
>= | greater or equal |
= | equal |
== | equal |
!= | not equal |
<< | bit shift left / up |
>> | bit shift right / down |
&& | logical AND (return 1 if True, 0 if False) |
|| | logical or (return 1 if True, 0 if False) |
& | bitwise and |
| | bitwise or |
! | logical not of second operand |
^ | bitwise xor |
- integers are 32 bit internally
- the codes for the different operations are taken from the C programming language.
Example
%op(%1.phy,+,1) - adds one to the physical number of the event owner. Which can be used to send a message to the next station, and creating a chain of events over all stations.
Back to Event_Handler#List_of_macros.