|
-
Oct 9th, 2024, 01:40 PM
#1
Re: Anybody have a IsHex() function? [Resolved]
20198 is valid Hex though, just because it doesn't contain any letters doesn't mean it's not Hex. The code above just tests whether a string contains only numbers and letters A through F.
-
Oct 9th, 2024, 01:56 PM
#2
Addicted Member
Re: Anybody have a IsHex() function? [Resolved]
Okay, yes it could be hex - lol. In my case, I have a program that tests an instrument through a serial port. It mostly responds in decimal, but every now and then it "burbs" and responds in HEX.
I had a similar For next loop to look for A-F, then I know the instrument burped, and to process the response accordingly.
I went searching to see if there was a built-in "IsHex" function (which there isn't) and found this old message string.
The bad thing is if the instrument "burps" and responds in hex, but without the A-F, I am going to get some wild data. - Hah, just ran in to that, but the program does detect Bull Shite data, well, mostly does.
I do like the "Like" statement, but for now will stick with the for next statement
Last edited by daveyk021; Oct 9th, 2024 at 02:03 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|