(Gast)
n/a Beiträge
|
AW: Ich scheitere grade an simpler Mathematik
26. Mär 2017, 19:33
Ungetestet hingedaddelt:
Delphi-Quellcode:
const
ciMaxLineLength = 248;
var
slIn : TStringList;
slOut : TStringList;
i : Integer;
sLine : String;
begin
slIn := TStringList.Create;
slOut := TStringList.Create;
slIn.LoadFromFile('Eingabe.txt');
for i := 0 to slIn.Count - 1 do begin
sLine := slIn[i];
if i = 0 then slOut.Add('NOTE ' + Copy(sLine,1,ciMaxLineLength)
else slOut.Add('CONC ' + Copy(sLine,1,ciMaxLineLength);
while Length(sLine > ciMaxLineLength do begin
sLine := Copy(sLine,ciMaxLineLength + 1,Length(sLine));
slOut.Add('CONT ' + Copy(sLine,1,ciMaxLineLength));
end;
end;
slOut.SaveToFile('Ausgabe.txt');
slOut.Free;
slIn.Free;
end;
|
|
Zitat
|