Hexidecimal to decimal Flowgorithm
Im confused about the functions and syntax. I need help in creating a flowgorithm that converts hexadecimal to decimal. I'd like to learn more about flowgorithm. I already tried making one and there are alot of errors like initializing and strings manipulation and alsoconverting string to integer. I am a beginner in this field.
I know that nobody will read this...
Let's assume that the question is "I have a String with the hexadecimal representation of a non negative number. How do I convert it into an Integer?"
First you need to be able to convert a single character into its value. We need to use the ASCII value of each char with
ToCode(). Subtracting 48 you take numbers to their values. A nice way to manage uppercase and lowercase A to F is to take the reminder after dividing by 32 and then subtracting 7 gives the corresponding value:Now it's just a matter of applying the same function to every character of the string and multiplying by the correct power of 16:
An example of using it:
The XML version: