Hex$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
   Hex$(A$)
   HEX$(<string>)


The '''Hex$(A$)''' [[internal function]] returns the string represented by A$, where A$ is in hexadecimal notation.
The '''Hex$''' [[internal function]] returns the string represented by A$, where A$ is in hexadecimal notation.


====Comments and Examples====
====Comments and Examples====
Line 12: Line 12:
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).
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.
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]] section.


====Related Functions====
====Related Functions====

Latest revision as of 17:22, 22 May 2014

 HEX$(<string>)

The Hex$ 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 section.

Related Functions

UnHex$ (Inverse of Hex$)