
7-6
Section
Details of BASIC Commands
161
hex$
Syntax:
HEX
$(<numerical expression>)
Description:
Function Converts the numerical expression into a hexadecimal character string.
The numerical expression must be in the range: [-2147483648…2147483647].
The resulting character string will be in the hexadecimal range: [0…FFFFFFFF].
Remarks:
Note:
1.
Single-precision or double-precision floating-point expressions will be truncated
before the conversion.
2.
If a floating-point value is within the short integer range, the value will be converted
to a hexadecimal integer. If the floating-point value is within the range of a long
integer, the long integer will be converted to a hexadecimal. If the value is outside
the long integer range, an “OVERFLOW” error (code B006) will occur.
Examples:
> 10 PRINT "DEC", "HEX"
> 20 FOR I = 1 TO 16
> 30 PRINT I,HEX$(I)
> 40 NEXT I
> RUN
DEC
HEX
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9
9
10
A
11
B
12
C
13
D
14
E
15
F
16
10
>
See also:
OCT
$
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...