There is a problem wiht Num2Dec. for Hex := 'G' Dec2Numb(Numb2Dec(Hex, 16) - 1, {Length(Hex)} 2, 16) will not refuse 'G' as an invalid hexadecimal number. The result would be 'F'. Antônio