Actions

Difference between revisions of "Tmp statement"

From Zenitel Wiki

(New page: Event_Handler statement - Write Temporary Variable Format: '''tmp index "<string>" ''' Write ''<string>'' to temporary variable number ''index''. Temporary variables (strings) are nu...)
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{AI}}
 
[[Event_Handler]] statement - Write Temporary Variable
 
[[Event_Handler]] statement - Write Temporary Variable
  
 
Format: '''tmp index "<string>" '''
 
Format: '''tmp index "<string>" '''
  
Write ''<string>'' to temporary variable number ''index''. Temporary variables (strings) are numbered 0 to 9. Temporary variable lives only within the action string! Each variable is a text string, with maximum length of  126 characters  
+
Write ''<string>'' to temporary variable number ''index''.  
 +
 
 +
*Temporary variables (strings) are numbered 0 to 9.  
 +
*Temporary variable lives only within the action string!  
 +
*Each variable is a text string, with maximum length of  126 characters  
 +
*Temporary variables are read with EventHandler macro [[%tmp]].
  
  
Line 13: Line 19:
 
  endif
 
  endif
  
Temporary variables is read with EventHandler macro [[%tmp]].
+
Note that you can use tmp statement for numeric values also. Just enclose the value in "". Example:
 +
 
 +
tmp 0 "%op(%tmp(0),+,1)"
 +
if %op(%tmp(0),=,5)
 +
  stop
 +
endif
 +
 
  
 
<p>
 
<p>
  
Back to [[Event_Handler#Statements]].
+
Back to [[Event_Handler#Built-In Action Commands]].
 +
 
 +
[[Category:Event Handler]]
 +
[[Category:Built-In Action Commands]]

Latest revision as of 15:19, 4 October 2019

AI.png

Event_Handler statement - Write Temporary Variable

Format: tmp index "<string>"

Write <string> to temporary variable number index.

  • Temporary variables (strings) are numbered 0 to 9.
  • Temporary variable lives only within the action string!
  • Each variable is a text string, with maximum length of 126 characters
  • Temporary variables are read with EventHandler macro %tmp.


Example:

tmp 0 "%sscan(%edi,connect)"   
if %tmp(0)
 $call L%scutf(%tmp(0), ,2) L%scutf(%tmp(0), ,4)   
endif

Note that you can use tmp statement for numeric values also. Just enclose the value in "". Example:

tmp 0 "%op(%tmp(0),+,1)"
if %op(%tmp(0),=,5)
  stop
endif 


Back to Event_Handler#Built-In Action Commands.