"Stephen Posey" <[EMAIL PROTECTED]> wrote
> The HTML standard has no requirement for a particular line
> break sequence in the text of the HTML; whether Carriage
> Return, Line Feed, or a combination; or any line breaks at
> all for that matter.
Agreed, in fact I habitually remove all line-breaks from my (plain
HTML) web pages so that they load as fast as possible.
They display correctly in browsers but are very difficult to read in a
text editor..
The OP ("Delphi") wrote
> When I load this file into Textpad it show 13 lines
I am not familiar with Textpad but I suspect that it uses a Richedit
which respects Unix-style line-terminators (^J). Thus, if the file
contained ^J terminators, he would see the 13 lines, even though
readln reads the file as a single line.
I suggest that "Delphi" tries something like::
AssignFile(F, sPathAndFileName_);
Reset(F);
Try
Readln(F, sInput);
sInput := AdjustLineBreaks (sInput);
MyStringLisit := tStringList.Create;
Try
MyStringList.Text := sInput;
For i := 0 to MyStringList.Count - 1 do begin
InputLine := TLLine.Create; // not sure what's going on here
InputLine.sLine := MyStringList[i];
liBeginPos := Pos('<br>Text: ---(', MyStringList[i]) + 14;
liEndPos := Pos(')---', MyStringList[i]);
sDateTime := Copy(InputLine.sLine, liBeginPos,
liEndPos - liBeginPos);
strlstLogs.AddObject(sDateTime, InputLine); // ??
end;
finally
MyStringList.Free;
end;
finally
CloseFile(F);
end;
// ***** Untested ********
This should work if all the line-terminators are ^J-style but not if
there is a mixture of ^J and ^M^J line-terminators
(or if there are any ^J^M line-terminators).
But either of these contingencies should be easily catered for.
Henry Bartlett
email: hambar at microtech dot com dot au
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi