Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

back in the good old typewriter days you used to have a trigger that could perform a

 

carriage return

 

and a

 

line feed.

 

hence crlf.

 

 

the trigger could also do a linefeed without a carriage return.

.nerd
Posted
The recommended .Net version though is System.Environment.NewLine()
.Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Posted

thanks to everyone who replied........very helpfull im new to this forum and of course vb.net environment i think this forum is da bomb................thank u mutant,Heiko and AndreRyan. thanks guys !!

 

next time i know where to ask some toughies! hehehehe

  • *Experts*
Posted
There is no real difference, except that vbCrlf is not a .net framework object. You will get the same thing no matter which one you use.
Posted

Besides the result is same, we also need to consider the performance or furture maintenance, since you said "vbCrLf" is not .NET Framework object, then we should use System.Environment.NewLine()?

 

In "NET Framework Class Library" there is not further explanation for either "vbCrLf" or "System.Environment.NewLine()", is there anyway I can find more information about it? Just curious about the different between both method....

  • *Experts*
Posted

bCrlf will not lower your app's performance.

http://www.zdnet.com.au/builder/dotnet/story/0,2000042147,20269716,00.htm

Quote from this website:

Also, this library provides access to common environment constants that VB developers have learned to use like vbCrLf. You create the same constants by using either the System.Environment.Newline method or System.Convert.ToChar(13) & System.Convert.ToChar(10). Constants like vbCrLf map directly to underlying framework calls and should have no impact on the performance. In the case of vbCrLf, the compiler optimises it to a single string; if it is a variable, it maps directly to \r\n, which translates to a carriage return. Using statements that map directly to underlying framework calls like msgbox, which maps directly to the .NET Framework MessageBox, have little or no effect on performance since the underlying IL will be basically the same.

  • *Gurus*
Posted

A newline character on Windows is a carriage return plus a linefeed. Hence the System.Environment.Newline constant. If someone ports the framework to some other platform, a newline character may only be a carriage return or a linefeed on its own. vbCrLf will always be both.

 

Having said that, anyone who ports the framework will almost undoubtedly be trying to be compatible with the Windows one, so they'll leave it as a carriage return and linefeed.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

You mean other platform will use either "vbCr" or "vbLf"? so if I use "vbCrLf", I will have problem? except in windows environment?

 

So, you suggest use "System.Environment.NewLine()"?

  • 6 years later...
  • Leaders
Posted
This is already explained in this thread that you are grave-digging. If you have a more specific question, such as "what is a linefeed?" by all means, ask, but in a new thread please.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...