|
Post by Rod on Apr 27, 2018 6:40:44 GMT -5
This is a function that checks a string is valid hex data, if not it returns an empty string.
a$="FEE1" b$="0123456789ABCDEF" print ishex$(a$,b$) a$="01JK" print ishex$(a$,b$) wait
function ishex$(a$,b$) b$=upper$(b$) a$=upper$(a$) for n= 1 to len(a$) if instr(b$,mid$(a$,n,1))=0 then illegal=1 else c$=c$+mid$(a$,n,1) end if next if not(illegal) then ishex$=c$ end function
Feel free to add your own little handy functions. Getting the name right is the first step.
|
|
|
Post by sarmednafi on Apr 27, 2018 7:02:37 GMT -5
Thank you Rod.
All the best.
|
|