I am converting an old project that was written in Delphi 7 to newest version (Delphi Tokyo), In the old code there is this function that scrambles and unscrambles text but when I read the scrambled text with the same program compiled in Delphi Tokyo it just produces garbage.
Does anyone here know why the same code behaves and gives different result compiled with different versions of Delphi ?
Here is the function :
function TForm2.EnDeCrypt(const Value : String) : String;
var
CharIndex : integer;
begin
Result := Value;
for CharIndex := 1 to Length(Value) do
Result[CharIndex] := chr(not(ord(Value[CharIndex])));
end;