procedure ReadDosTextFile(FileName: string; List: TStrings);
var
S: string;
i: integer;
begin
List.BeginUpdate;
try
List.LoadFromFile(FileName);
for i:=0 to List.Count - 1 do begin
S:=List[i];
OemToChar(PChar(S), PChar(S));
List[i]:=S;
end;
finally
List.EndUpdate;
end;
end;
procedure WriteDosTextFile(FileName: string; List: TStrings);
var
S: string;
I: integer;
L: TStringList;
begin
L:=TStringList.Create;
try
L.Assign(List);
for i:=0 to L.Count - 1 do begin
S:=L[i];
CharToOem(PChar(S), PChar(S));
L[i]:=S;
end;
L.SaveToFile(FileName);
finally
L.Free;
end;
end;
|