by Dark_Wolf (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 29th April 2000
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
This little source code checks if a String is a valid hexadecimal value
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
No comments have been posted about This little source code checks if a String is a valid hexadecimal value. Why not be the first to post a comment about This little source code checks if a String is a valid hexadecimal value.