At 1:48 PM +1100 3/11/06, Tom Benson wrote:

if right(textInputStream.Readall,1) = EndOfLine then

Better make that Right(TextInputStream.ReadAll, EndOfLine.Len) instead; you shouldn't assume that EndOfLine is a single character.

And of course, it's a bit inefficient to read the whole file just to check the last character or two. Better might be something like (assuming tis is your TextInputStream, and f is the file it was opened from):

  tis.Position = f.Length - EndOfLine.Len
  if tis.Read( EndOfLine.Line ) = EndOfLine then

Same idea, just skips some extra reading.

HTH,
- Joe

--

Joseph J. Strout
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to