Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert IPv4 dotted quad into four decimal values
#2
Ah, I figured out one way to do this. Break up the string variable into its separate characters, as I have already done, then use

digit(j) = Val(char$(i))

to build up the decimal value of each byte of the address. I don't even need to change every dot to a comma. I loop through each address byte until I reach a dot delimiter, and build up the decimal value of that byte. Then move on from there to the next dot delimiter, build up that decimal value. There might be a more clever way, but at least I got this way to work perfectly. Not that much code, once I'm done cleaning it up. Also have to build in checks, to make sure not to exceed valid values.
Reply


Messages In This Thread
RE: Convert IPv4 dotted quad into four decimal values - by bert22306 - 09-02-2022, 02:18 AM



Users browsing this thread: 1 Guest(s)