Re: Environment.Newline

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



C# implementations do not always run on Windows, no. Google for "rotor", "mono", and "dotgnu" individually and you'll find examples of non-Windows implementations of the C# language, compiler, and runtime environment. as far as I know, the mono project is the furthest advanced. they have a complete 1.1 environment written, and its all open source. it compiles and runs anywhere Unix or Windows does.

Also, should it be the responsibility of the programmer to know exactly what the newline character is on any given system? personally, I don't think it should be. True, there are only two types of newline currently if you only count the latest PC operating systems, and hopefully that narrows to one in the future, but should it be the responsibility of the programmer to determine what operating system he is on and write logic that outputs the currect system newline?

jeremiah


Peter Kirk wrote:
Hi

I would like to ask a little bit about the value Environment.Newline: what is it and what is the point of it? Ok, I can see in the docs that it represents "newline" for the current platform - I assume that it is a runtime property, and not compile time?

But won't it always be the same anyway - does dotnet run on anything other than windows platforms? So isn't newline always the same?

And what if I have a program that uses "Environment.Newline" to generate a string and send it to a program running on another platform - the other platform might have a completely different "newline" concept, and therefore to use Environment.Newline is pointless isn't it?

Thanks for any comments,
Peter


.



Relevant Pages

  • Re: interface
    ... Writing portable code has nothing to do with the operating system or ... That having said, if you want to use only one compiler, GCC is a very ... Don't mess around with the Windows API. ... Even if you're working only on one platform, ...
    (comp.programming)
  • Re: Environment.Newline
    ... So isn't newline always the same? ... a string and send it to a program running on another platform - the other ... and runs anywhere Unix or Windows does. ... if you only count the latest PC operating systems, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What is the benefit to me of .NET as an end-user?
    ... Even in Windows, there are multiple platforms. ... vs Win CE (a subset of Win32). ... Also, most would consider the browser a different platform than Win32, ... compiler converts it to native machine instructions. ...
    (borland.public.delphi.non-technical)
  • Re: Introducing the Intel(R) Fortran Compiler, Standard and Professional Editions, for Mac OS*
    ... That would encourage Intel Fortran users on one ... platform and just charge for the compiler. ... The Language Reference manual for Windows and for MaxOsX sure look ...
    (comp.lang.fortran)
  • mex command
    ... I am trying to install HSPICE toolbox and i am using windows seven. ... To compile the loadsig function for a different platform, ... directory containing loadsig.c within Matlab, and then type mex loadsig.c within Matlab. ... Select a compiler: ...
    (comp.soft-sys.matlab)