Difference between revisions of "Dfmt (macro)"
From Zenitel Wiki
(New page: %dfmt( , ) : Event_Handler macro for format decimal number to text. Format: %dfmt(integer,format-char) * no space is allowed between ',' and the ''format-char''. * The ''format-ch...) |
|||
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | %dfmt( , ) : [[Event_Handler]] macro for | + | {{AI}} |
+ | %dfmt( , ) : [[Event_Handler]] macro for converting decimal value to hex, octal or ASCII | ||
Line 11: | Line 12: | ||
| x || hex, lower case text | | x || hex, lower case text | ||
|- | |- | ||
− | | X || hex, | + | | X || hex, upper case text |
|- | |- | ||
| o || octal text | | o || octal text | ||
Line 18: | Line 19: | ||
|- | |- | ||
|} | |} | ||
+ | |||
+ | * [[Event_Handler#Formating]] can be added after the ''format-char''. | ||
+ | * %dfmt was introduced in AMCD 11.0.1.2 | ||
+ | * %dfmt(,c) can be used to make control codes from variables. | ||
Line 23: | Line 28: | ||
EDO "conn %dfmt(%1.phy,x) \n" | EDO "conn %dfmt(%1.phy,x) \n" | ||
+ | |||
+ | * "%dfmt(43,x)" -> "2b" | ||
+ | * "%dfmt(43,X)" -> "2B" | ||
+ | * "%dfmt(43,o)" -> "53" | ||
+ | * "%dfmt(43,c)" -> "+" | ||
+ | |||
+ | <p> | ||
+ | |||
+ | |||
+ | Back to [[Event_Handler#List_of_macros]]. | ||
+ | |||
+ | [[Category:Event Handler]] | ||
+ | [[Category:Event Handler macros]] |
Latest revision as of 14:57, 21 November 2023
%dfmt( , ) : Event_Handler macro for converting decimal value to hex, octal or ASCII
Format: %dfmt(integer,format-char)
- no space is allowed between ',' and the format-char.
- The format-char controls the conversion of the integer. format-char the can be one of:
x | hex, lower case text |
X | hex, upper case text |
o | octal text |
c | character value (ASCII) |
- Event_Handler#Formating can be added after the format-char.
- %dfmt was introduced in AMCD 11.0.1.2
- %dfmt(,c) can be used to make control codes from variables.
Examples
EDO "conn %dfmt(%1.phy,x) \n"
- "%dfmt(43,x)" -> "2b"
- "%dfmt(43,X)" -> "2B"
- "%dfmt(43,o)" -> "53"
- "%dfmt(43,c)" -> "+"
Back to Event_Handler#List_of_macros.