IsHex

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
%>

value

Views 501 Downloads 148

''

JeffSmith
26
Texts + Strings Classic ASP
Revisions

v1.0