Actions

Difference between revisions of "Character escape codes"

From Zenitel Wiki

Line 1: Line 1:
 
Escape sequences use an escape character to change the meaning of the characters which follow it. Escape sequences can be used for two purposes:
 
Escape sequences use an escape character to change the meaning of the characters which follow it. Escape sequences can be used for two purposes:
* to use non-printable characters in action strings
+
* to use non-printable characters in action strings, e.g. in [[EDO]] and [[MPP]] commands
 
* quoting: ignore special meaning of a character in eventhandler parser.
 
* quoting: ignore special meaning of a character in eventhandler parser.
  
 
The escape sequences are substituted when the eventhandler reads the action string. In the case of Data Protocol Commands ( @ $ ), the  escape sequences are substituted ''before'' the messages are sent to the Data Protocol Router / Handler.
 
The escape sequences are substituted when the eventhandler reads the action string. In the case of Data Protocol Commands ( @ $ ), the  escape sequences are substituted ''before'' the messages are sent to the Data Protocol Router / Handler.
  
In the AlphaCom the character backslash (\) is used as escape character. Escape sequences might be used in the [[EDO]] command to generate non-printable [http://en.wikipedia.org/wiki/ASCII ASCII] characters.
+
In the AlphaCom the character backslash (\) is used as escape character.
  
Some frequently used escape sequences:
 
\r = Carriage Return
 
\n = Line Feed
 
\t = Tab
 
\xhh = hh is any ASCII value in HEX
 
  
 
Escape sequences:
 
Escape sequences:

Revision as of 14:27, 21 October 2008

Escape sequences use an escape character to change the meaning of the characters which follow it. Escape sequences can be used for two purposes:

  • to use non-printable characters in action strings, e.g. in EDO and MPP commands
  • quoting: ignore special meaning of a character in eventhandler parser.

The escape sequences are substituted when the eventhandler reads the action string. In the case of Data Protocol Commands ( @ $ ), the escape sequences are substituted before the messages are sent to the Data Protocol Router / Handler.

In the AlphaCom the character backslash (\) is used as escape character.


Escape sequences:

Escape sequence Result Hex code Description
\, , 2C Comma
\( ( 28 Opening parenthese
\) ) 29 Closing parenthese
\" " 22 Double quote
\; ; 3B Semicolon
\\ \ 5C Backslash
\% % 25 Percent
\t TAB 09 ASCII TAB (Horisontal tab)
\s SP 20 Space
\r CR 0D Carriage return
\n LF 0A Line feed
\a BEL 07 Bell (Alert)
\b BS 08 Backspace
\0 NUL 00 ASCII NUL
\l   80 Extended NUL ('\x80')
\!     Comment / ignore rest of string
\xhh     'hh' is the ASCII character code as 2 hex digits. Note that you must use 2 digits.
\#hh     'hh' is the ASCII character code as 2 hex digits. Note that you must use 2 digits.



By using the escape sequence '\xhh' all sorts of ASCII characters can be generated.