Hello, Just curious what's going on here. In debug mode can see i = Length(aBuf) when it first steps into the loop And it goes from Length down to 0 instead of 0 to Length repeat BlockRead(F2, aBuf, SizeOf(aBuf), iNumRead); for i := 0 to Length(aBuf) - 1 do begin if (aBuf[i] = #13) and (aBuf[i+1] = #10) then begin Inc(iRows); end; end; for i := 0 to Length(aBuf) - 1 do begin aBuf[i] := #0; end; until iNumRead = 0; Tried using Low and High instead of Length - same thing. Why ? Does it have anything to do with aBuf being a static array declared as: aBuf: array[1..65536] of Char; Thank you, Sergei --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
- [DUG]: Number of lines in text file Sergei Stenkov
- RE: [DUG]: Number of lines in text file Max Nilson
- RE: [DUG]: Number of lines in text file Sergei Stenkov
- Re: [DUG]: Number of lines in text file Alex Kouznetsov
- RE: [DUG]: Number of lines in text file Sergei Stenkov
- RE: [DUG]: Number of lines in text file Max Nilson
- Re: [DUG]: Number of lines in text file Neven MacEwan
- RE: [DUG]: Number of lines in text ... Max Nilson
- Re: [DUG]: Number of lines in t... Sergei Stenkov
- Re: [DUG]: Number of lines in t... Neven MacEwan
- [DUG]: IDE behaviour Rohit Gupta
- [DUG]: TTreeView Rohit Gupta
- Re: [DUG]: TTreeView Steve Peacocke
- [DUG]: Calculated Fields Rohit Gupta
- RE: [DUG]: Number of lines in text file Sergei Stenkov
- Re: [DUG]: Number of lines in text file Neven MacEwan
- RE: [DUG]: Number of lines in text file Sergei Stenkov
- Re: [DUG]: Number of lines in text file Phil Scadden
- RE: [DUG]: Number of lines in text file Andrew Dibley