in reply to Invalid Hex Conversion?

Where in your code do you convert the hex string into a number that can be incremented properly?

Replies are listed 'Best First'.
Re^2: Invalid Hex Conversion?
by tfredett (Sexton) on Jul 21, 2011 at 18:48 UTC
    I increment $Address in the second line of the for loop with $Address++. Is this an improper way to do this? Because the script works fine, up to the point where you pass it a character, then it produces the bug I described.

      Incrementing is magical, but not THAT magical :)

      There is no way to tell if you want the increment to change "19" into "1A" rather than "20", for example.

      Use $value = hex($string) to get a regular number before you apply math to it.

        Thanks to everyone, it was indeed that I hadn't converted it from a string to a regular number before the applying the necessary math to it. Thanks guys!