und falls man doch die memos in die ini packen will:
Hilfsfunktion
Delphi-Quellcode:
function ConvStrToHex(AStr: String): String;
var LGiveback, LStr: String;
LCount: Integer;
begin
setlength(LGiveback, length(AStr) * 2);
for LCount := 1 to length(AStr) do
begin
LStr := IntToHex(Byte(AStr[LCount]), 2);
move(LStr[1], LGiveback[(LCount - 1) * 2 + 1], 2);
end;
result := LGiveback;
end;
function ConvHexToStr(AHex: String): String;
var LGiveback: String;
LCount: Integer;
begin
setlength(LGiveback, Trunc(length(AHex) / 2));
for LCount := 0 to length(LGiveback) - 1 do
LGiveback[LCount + 1] := Char(StrToInt('$' + AHex[LCount * 2 + 1] + AHex[LCount * 2 + 2]));
result := LGiveback;
end;
so wird in die Ini-Datei gespeichert
ini.WriteString('Section', 'MemoInhalt', ConvStrToHex(Memo1.Text));
und so wirds wieder ausgelesen
Memo1.Text := ConvHexToStr(ini.ReadString('Section', 'MemoInhalt', ''));