I converting a lecacy app from Delphi 7 to Delphi 2009. I got this error: E2010 Incompatible types: 'Char' and 'AnsiChar' How can I fix it ? I tried to declare Alphabet: Ansistring[AlphabetLength] but that failed.
const
AlphabetLength = 64;
Alphabet: string[AlphabetLength] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
function TBase64.ValueToCharacter(value: Byte; var character: char): boolean;
begin
Result := true;
if (value > AlphabetLength-1) then
Result := false
else
// Compile error E2010 Incompatible types: 'Char' and 'AnsiChar'
character := Alphabet[value+1];
end;
function TBase64.CharacterToValue(character: char; var value: byte): boolean;
begin
Result := true;
value := Pos(character, Alphabet);
if value = 0 then
Result := false
else
value := value-1;
end;