function AnyToInt(c: Char): Integer; begin if c in ['0'..'9'] then Result:=StrToInt(c) else if c in ['A'..'Z'] then Result:=10+Ord(c)-Ord('A') else raise Exception.Create('AnyToInt Exception'); end; ShowMessage(IntToStr(AnyToInt('C')*8));