UnHex$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (1 revision)
(No difference)

Revision as of 14:11, 15 January 2012

UnHex$(A$)

The UnHex$ internal function converts A$ to hexadecimal representation.

Comments and Examples

UnHex$ can be used to examine the packed decimal representation (PD format) of a number written to an internal or external file.

00010 OPEN #1: "name=billtest,replace,recl=4",INTERNAL,OUTIN,RELATIVE
00020 WRITE #1,USING 30,REC=1: 4.56, -4.56
00030 FORM 2*PD 2.2
00040 READ #1,USING 50,REC=1: A$, B$
00050 FORM 2*C 2
00060 REREAD #1,USING 30: A, B
00060 PRINT A;"in PD 2.2 format is  -"; UNHEX$(A$)
00070 PRINT B;"in PD 2.2 format is  -"; UNHEX$(B$)

The above program will print the following:

4.56 in PD 2.2 format is  - 456F
-4.56 in PD 2.2 format is - 456D

See the KStat$ function for another example of using UnHex$.

Related Functions

Inverse function is Hex$.