HEXVAL

Top  Previous  Next

Action

Convert string representing a hexadecimal number into a numeric variable.

 

 

Syntax

var = HEXVAL( x )

 

 

Remarks

Var

The numeric variable that must be assigned.

X

The hexadecimal string that must be converted.

 

In VB you can use the VAL() function to convert hexadecimal strings.

But since that would require an extra test for the leading &H signs that are required in VB, a separate function was designed.

 

 

See also

HEX , VAL , STR , BIN , BINVAL

 

 

Example

$regfile = "m48def.dat"                                   ' specify the used micro

$crystal = 8000000                                         ' used crystal frequency

$baud = 19200                                               ' use baud rate

$hwstack = 32                                               ' default use 32 for the hardware stack

$swstack = 10                                               ' default use 10 for the SW stack

$framesize = 40                                             ' default use 40 for the frame space

 

Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0

 

Dim L As Long

 

Dim S As String * 8

Do

Input "Hex value " , S

L = Hexval(s)

Print L ; Spc(3) ; Hex(l)

Loop