Actions

Difference between revisions of "Character escape codes"

From Zenitel Wiki

Line 15: Line 15:
 
! style="background:#ffdead;" width="150" | Description
 
! style="background:#ffdead;" width="150" | Description
 
|-
 
|-
| align=center| , || align=center|%, || align=center|%c || 2C || Comma
+
| align=center| , || align=center|\, || align=center|%c || 2C || Comma
 
|-
 
|-
| align=center| ( || align=center|%( || align=center|%o || 28 || Opening parenthese
+
| align=center| ( || align=center|\( || align=center|%o || 28 || Opening parenthese
 
|-
 
|-
| align=center| ) || align=center|%) || align=center|%p || 29 || Closing parenthese
+
| align=center| ) || align=center|\) || align=center|%p || 29 || Closing parenthese
 
|-
 
|-
| align=center| " || align=center|%" || align=center|%d || 22 || Double quote
+
| align=center| " || align=center|\" || align=center|%d || 22 || Double quote
 
|-
 
|-
| align=center| ; || align=center|%; || align=center|%e || 3B || Semicolon
+
| align=center| ; || align=center|\; || align=center|%e || 3B || Semicolon
 
|-
 
|-
| align=center| \ || align=center|%\ ||   || 5C || Backslash
+
| align=center| \ || align=center|\\ ||   || 5C || Backslash
 
|-
 
|-
| align=center| % || align=center|%% ||   || 25 || Percent
+
| align=center| % || align=center|\% ||   || 25 || Percent
 
|-
 
|-
| align=center| TAB || align=center|%t ||   || 09 || ASCII TAB (Horisontal tab)
+
| align=center| TAB || align=center|\t ||   || 09 || ASCII TAB (Horisontal tab)
 
|-
 
|-
| align=center| SP || align=center|%s ||   || 20 || Space
+
| align=center| SP || align=center|\s ||   || 20 || Space
 
|-
 
|-
| align=center| CR || align=center|%r ||   || 0D || Carriage return
+
| align=center| CR || align=center|\r ||   || 0D || Carriage return
 
|-
 
|-
| align=center| LF || align=center|%n ||   || 0A || Line feed
+
| align=center| LF || align=center|\n ||   || 0A || Line feed
 
|-
 
|-
| align=center| BEL || align=center|%a ||   || 07 || Bell (Alert)
+
| align=center| BEL || align=center|\a ||   || 07 || Bell (Alert)
 
|-
 
|-
| align=center| BS || align=center|%b ||   || 08 || Backspace
+
| align=center| BS || align=center|\b ||   || 08 || Backspace
 
|-
 
|-
| align=center| NUL || align=center|%0 ||   || 00 || ASCII NUL
+
| align=center| NUL || align=center|\0 ||   || 00 || ASCII NUL
 
|-
 
|-
| align=center|   || align=center|%xhh || align=center|%#hh ||   || 'hh' is the ASCII character code as 2 hex digits. Note that you must use 2 digits.
+
| align=center|   || align=center|\xhh || align=center|\#hh ||   || 'hh' is the ASCII character code as 2 hex digits. Note that you must use 2 digits.
 
|-
 
|-
| align=center|   || align=center|%l ||   || 80 || Extended NUL ('\x80')
+
| align=center|   || align=center|\l ||   || 80 || Extended NUL ('\x80')
 
|-
 
|-
| align=center|   || align=center|%q ||   ||   || to quote next character in string (if not parameter or end of string)
+
| align=center|   || align=center|\q ||   ||   || to quote next character in string (if not parameter or end of string)
 
|-
 
|-
 
|}
 
|}
 
<br>
 
<br>
\ can be used instead of %.
 
  
 
<br>
 
<br>
By using the escape sequence '%xhh' all sorts of ASCII characters can be sent on the EDO port.
+
By using the escape sequence '\xhh' all sorts of ASCII characters can be sent on the EDO port.
 
<br><br>
 
<br><br>
 
Example: CR (Carriage Return), which has the hexadecimal value 0D, can be generated by any of the following escape sequences:
 
Example: CR (Carriage Return), which has the hexadecimal value 0D, can be generated by any of the following escape sequences:
 
   
 
   
 
  \r
 
  \r
%r
 
 
  \x0D
 
  \x0D
%x0D
 
%#0D
 
  
 
[[Category:Event Handler]]
 
[[Category:Event Handler]]

Revision as of 14:02, 21 October 2008

Escape sequences use an escape character to change the meaning of the characters which follow it. In the Event Handler backslash (\) is used as escape character. Escape sequences might be used in the EDO command to generate non-printable ASCII characters.

Some frequently used escape sequences:

\r = Carriage Return
\n = Line Feed
\t = Tab 
\xhh = hh is any ASCII value in HEX

Escape sequences:

Char Code Alt. code Hex Description
, \, %c 2C Comma
( \( %o 28 Opening parenthese
) \) %p 29 Closing parenthese
" \" %d 22 Double quote
; \; %e 3B Semicolon
\ \\   5C Backslash
% \%   25 Percent
TAB \t   09 ASCII TAB (Horisontal tab)
SP \s   20 Space
CR \r   0D Carriage return
LF \n   0A Line feed
BEL \a   07 Bell (Alert)
BS \b   08 Backspace
NUL \0   00 ASCII NUL
  \xhh \#hh   'hh' is the ASCII character code as 2 hex digits. Note that you must use 2 digits.
  \l   80 Extended NUL ('\x80')
  \q     to quote next character in string (if not parameter or end of string)



By using the escape sequence '\xhh' all sorts of ASCII characters can be sent on the EDO port.

Example: CR (Carriage Return), which has the hexadecimal value 0D, can be generated by any of the following escape sequences:

\r
\x0D