Quote Originally Posted by ukemigrant View Post
If you're sure your data really just consists of the digits and letters A through F, use this instead. Including comments will help when you come back to it later too.

Code:
' This works because 0 - 9 have decimal codes 48 - 57 and A - F have 
' decimal codes 65 - 70 in ASCII
HEXConvert:
IF DATAA >= 65 THEN
	DATAA = DATAA - 55 ' 65 - 55 = 10, 66 - 55 = 11 etc
else
	DATAA = DATAA - 48 ' 48 - 48 = 0, 49 - 48 = 2 etc
ENDIF

RETURN
http://www.asciitable.com/.
Of course 49 - 48 <> 2 . Luckily it was in the comments but still...