Ahh, the joy of learning to sniff out syntax errors ...
Line numbers on the code would make this easier for people here to look at, but there are a few lines of code that look really fishy to me.
One thing is to ask yourself what these two declarations REALLY mean -- they do NOT mean what you think.
hexToBinary: array['0'..'F'] of string =
Here's an ASCII table. Count up how many characters are between '0' and 'F'
https://www.ascii-code.com
And I have no idea how the compiler might be treating this if it's not raising any sort of warnings or errors...
binaryToHex: array['0000'..'1111'] of Char =