Hex$: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
Hex$(A$) | Hex$(A$) | ||
The '''Hex$''' [[internal function]] returns the string represented by A$, where A$ is in hexadecimal notation. | The '''Hex$(A$)''' [[internal function]] returns the string represented by A$, where A$ is in hexadecimal notation. | ||
====Comments and Examples==== | ====Comments and Examples==== | ||
This function is frequently used to send a group of special characters to a printer. | This function is frequently used to send a group of special characters to a printer. | ||
Line 14: | Line 15: | ||
====Related Functions==== | ====Related Functions==== | ||
[[UnHex$]] (Inverse of Hex$) | |||
<noinclude> | <noinclude> | ||
[[Category:Internal Functions]] | [[Category:Internal Functions]] | ||
</noinclude> | </noinclude> |
Revision as of 17:14, 26 January 2012
Hex$(A$)
The Hex$(A$) internal function returns the string represented by A$, where A$ is in hexadecimal notation.
Comments and Examples
This function is frequently used to send a group of special characters to a printer.
00010 PRINT #255,USING 20: HEX$("1B51") 00020 FORM C 2,SKIP 0
Line 10 sends Esc and Q (ASCII values 1B and 51 in hexadecimal) to the printer. The SKIP 0 in line 20 makes sure that the printer stays on the same line (no line feed is added to the PRINT statement).
An additional common use of HEX$ is to activate printer translation as specified by PRINTER specifications in BRConfig.sys file. PRINTER specifications provide a way to minimize hardware differences between printers, usually without any program changes. All printer translations must begin with ASCII character 2B in hexadecimal notation, i.e., HEX$("2B"). There are more complex rules for valid values of the second character, but 00 will always work. Thus, many programs include HEX$("2B00") to begin printer translation. For more information, see the PRINTER specification in the BRConfig.sys chapter.
Related Functions
UnHex$ (Inverse of Hex$)