Re: Line too long ???
- From: Hans-Peter Diettrich <DrDiettrich1@xxxxxxx>
- Date: Tue, 16 Oct 2007 11:24:12 +0200
alanglloyd@xxxxxxx wrote:
Its difficult to prevent when you're adding strings from another(*
source with different linebreak standards. Perhaps you should write a
small app to select a file with a TOpenDialog and which passes the
filepthname to a procedure like ...
procedure CorrectLineBreaks(FPN : string);
var
SL : TStringList;
Str : string;
begin
SL := TStringList.Create;
try
SL.LoadFromFile(FPN);
Str := SL.Text;*)
AdjustLineBreaks(Str);
SL.Text := Str;
SL.SaveToFile(FPN);
finally
SL.Free;
end;
end;
AdjustLineBreaks() and loading/saving to a stringlist should sort it
out for you.
A TStringList doesn't store linebreaks, and splits the lines correctly on LoadFromFile, so it's sufficient to LoadFromFile followed by SaveToFile. Reading SL.Text will insert the defined linebreaks, so AdjustLineBreaks has nothing to do at all.
DoDi
.
- References:
- Line too long ???
- From: Stark
- Re: Line too long ???
- From: Rudy Velthuis
- Re: Line too long ???
- From: Stark
- Re: Line too long ???
- From: Rudy Velthuis
- Re: Line too long ???
- From: Stark
- Re: Line too long ???
- From: Rudy Velthuis
- Re: Line too long ???
- From: Stark
- Re: Line too long ???
- From: alanglloyd@xxxxxxx
- Line too long ???
- Prev by Date: Re: WaveOutOpen trouble
- Next by Date: Re: Component for reading DNG files
- Previous by thread: Re: Line too long ???
- Next by thread: Re: Line too long ???
- Index(es):
Relevant Pages
|