This little source code checks if a String is a valid hexadecimal value
This little source code checks if a String is a valid hexadecimal value
Rate This little source code checks if a String is a valid hexadecimal value
(1(1 Vote))
1 'Declare Variables
MyValue = Text1.Text 'Text to be analysed source
MyValue = "&H" + MyValue 'Tell vb that this string is a hexadecimal value
On Error GoTo ItsNoHex 'If the value is not valid, tell the user of it
MyValue1 = MyValue + &HFF 'Do a little test
MsgBox "This is a valid hexadecimal value!", , "Checking" 'Tell the user
Exit Sub 'The value is ok. Get out of here :)
ItsNoHex:
If Err = 13 Then 'See if the error is really a hexadecimal error
MsgBox "This is a invalid hexadecimal value!", , "Checking" 'Tell the user
End If
End Sub
This little source code checks if a String is a valid hexadecimal value Comments
No comments yet — be the first to post one!
Post a Comment