At 12:23 PM -0400 6/30/04, Barry Traver wrote:
The point is that when you work with a HTML file from a UNIX server and
you're breaking the file up into individual lines from an "editfield" or
"textbox," the delimiter isn't necessarily a carriage return plus a line
feed, so using something like cr, lf, and crlf in my code makes it
easier for me to keep track of what's going on.
True -- but just to take this opportunity to explore RB: you could
use EndOfLine.Windows, EndOfLine.Unix, and EndOfLine.Macintosh
instead. Also, an EditField will accept any standard line ending
when you dump text into it, and do the right thing. So will a
TextInputStream: when you use ReadLine, it'll read a line regardless
of what line ending it has.
Finally, when you're writing a file, you can just set
TextOutputStream.Delimiter to whatever line ending you want (e.g.
EndOfLine.Unix, or Chr(13), or whatever), and it'll write that after
each call to WriteLine.
So I think perhaps line endings are easier to deal with in RB, and
don't require any mucking about with ASCII codes most of the time.
Best,
- Joe
--
,------------------------------------------------------------------.
| Joseph J. Strout REAL Software, Inc. |
| joe at realsoftware dot com http://www.realsoftware.com |
`------------------------------------------------------------------'
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|