Re: Newline in Text Property

From: Tom Shelton (tom_at_mtogden.com)
Date: 04/20/04


Date: Tue, 20 Apr 2004 10:44:02 -0700

In article <408551a9$0$26139$9b622d9e@news.freenet.de>, Armin Zingler wrote:
> "Tom Shelton" <tom@mtogden.com> schrieb
>>
>> New lines are platform specific.
>
> There is no platform specific standard.

I'm not sure what you mean be standard? If your talking about a formal
standards body - then no, there isn't. But traditionally on *nix a
newline is a single lf (I know I said CR earlier). It's one of those
issues that tends to bite people when writing cross platform code. *nix
progams will almost always assume that a line terminates on LF, windows/dos
expects a cr/lf.

I'm really not sure what the argument is about. The fact is that it
unless you have specific reasons, I find that it is better not to
hardcode your line termination to a specific value - ControlChars.CrLf -
but to use System.Environment.NewLine. That way, I don't have to worry
about the difference because it will just do the right thing based on
the underlying platform. Look in the VB6 docs for vbNewLine - it is
essentially the same thing.

-- 
Tom Shelton [MVP]


Relevant Pages

  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... These days I don't do compiler maintenance, but I HAVE done in the past, so ... You had a chance to point out how adherence to the standard can improve ... >> compile it WITH MINOR MODIFICATIONS for a specific platform. ... > platform-specific extension to COBOL ...
    (comp.lang.cobol)
  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... > implementations that purport to conform to a COBOL standard is to write ... I DID think any old compiler would be able to ... compile it WITH MINOR MODIFICATIONS for a specific platform. ... >> Portability depends on where you plan to port (or more likely where ...
    (comp.lang.cobol)
  • Re: interesting use of NEXT SENTENCE vs. CONTINUE
    ... I DID think any old compiler would be able to ... > compile it WITH MINOR MODIFICATIONS for a specific platform. ... > not going to go to the Standard to see what SHOULD work. ... If you write your COBOL code avoiding the things that are marked as ...
    (comp.lang.cobol)
  • Re: C portability is a myth
    ... > solicitation for the availability of a compiler for a given platform. ... If the source is pure Standard C ... can be successfully ported to all implementations. ...
    (comp.lang.c)
  • Re: These are identical, right? char const* and const char*
    ... >> You gain working directly with the platform API in your code and thus ... I believe changing the default character set to UTF-8 would be ... >> platform specific APIs for those things not covered by the standard. ...
    (comp.lang.cpp)