Displaying Source Code(s)
|
|
Check a string to see if it is Hex
--------------------------------------------------------------------------------
Function IsHex(value)
Dim b, bb, i, j, s, values(15)
s = UCase(value)
values(0) = "0"
values(1) = "1"
values(2) = "2"
values(3) = "3"
values(4) = "4"
values(5) = "5"
values(6) = "6"
values(7) = "7"
values(8) = "8"
values(9) = "9"
values(10) = "A"
values(11) = "B"
values(12) = "C"
values(13) = "D"
values(14) = "E"
values(15) = "F"
bb = (Len(s) > 0)
For i = 1 To Len(s)
b = False
For j = 0 To 15
b = b Or (Mid(s, i, 1) = values(j))
Next
bb = bb And b
Next
IsHex = bb
End Function |
|
|