Difference between revisions of "%chg"
From Zenitel Wiki
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | %chg | + | {{AI}} |
+ | The '''%chg''' macro is used in the [[Event Handler]], and will return one value when the event goes ON, and another value when the event goes OFF. <br> | ||
+ | ===Syntax=== | ||
+ | '''%chg(ON_txt,OFF_txt)''' | ||
+ | Returns "ON_txt" when the event goes ON, "OFF_txt" when the event goes OFF | ||
− | + | ===Examples=== | |
− | Example: LOG | + | Example 1: |
− | Result | + | LOG "Door %1.dir is %chg(OPEN ,CLOSED)" |
− | Result | + | *Result in System Log when event goes ON: - "Door 123 is OPEN" |
+ | *Result in System Log when event goes OFF: - "Door 123 is CLOSED" | ||
+ | |||
+ | Example 2: | ||
+ | IF %chg(1,0) | ||
+ | LOG "Event goes ON" | ||
+ | stop | ||
+ | ENDIF | ||
+ | LOG "Event goes OFF" | ||
+ | |||
+ | |||
+ | |||
+ | Back to [[Event_Handler#List_of_macros]]. | ||
[[Category:Event Handler macros]] | [[Category:Event Handler macros]] | ||
[[Category:Event Handler]] | [[Category:Event Handler]] |
Latest revision as of 13:28, 16 December 2020
The %chg macro is used in the Event Handler, and will return one value when the event goes ON, and another value when the event goes OFF.
Syntax
%chg(ON_txt,OFF_txt)
Returns "ON_txt" when the event goes ON, "OFF_txt" when the event goes OFF
Examples
Example 1:
LOG "Door %1.dir is %chg(OPEN ,CLOSED)"
- Result in System Log when event goes ON: - "Door 123 is OPEN"
- Result in System Log when event goes OFF: - "Door 123 is CLOSED"
Example 2:
IF %chg(1,0) LOG "Event goes ON" stop ENDIF LOG "Event goes OFF"
Back to Event_Handler#List_of_macros.