Actions

Difference between revisions of "%op"

From Zenitel Wiki

m
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{AI}}
 
%OP( , , ) : [[Event_Handler]] macro for numeric calculations.  
 
%OP( , , ) : [[Event_Handler]] macro for numeric calculations.  
  
Line 59: Line 60:
  
 
Back to [[Event_Handler#List_of_macros]].
 
Back to [[Event_Handler#List_of_macros]].
 +
 +
[[Category:Event Handler macros]]
 +
[[Category:Event Handler]]

Latest revision as of 08:48, 4 October 2019

AI.png

%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.