New lines 
Author Message
 New lines

I see that the constant vbCrLf is still valid in vb.net. Is it ok to use it,
or is it better to use the system.environment.newline? Is there any drawback
on the use of old constants?

Thanks.



Mon, 19 Sep 2005 11:06:44 GMT  
 New lines
Hello Antonio,


Quote:
> I see that the constant vbCrLf is still valid in vb.net.
> Is it ok to use it, or is it better to use the
> system.environment.newline? Is there any drawback
> on the use of old constants?

I prefer ControlChars.NewLine.

;-)

Regards,
Herfried K. Wagner



Mon, 19 Sep 2005 06:29:46 GMT  
 New lines

Quote:
> I see that the constant vbCrLf is still valid in vb.net. Is it
> ok to use it, or is it better to use the
> system.environment.newline? Is there any drawback on the use of
> old constants?

I use vbCrlf because it's shorter and returns exactly the same as
environment.newline (and it's *not* part of the compatibility library).

Armin



Mon, 19 Sep 2005 06:40:43 GMT  
 New lines
Hi Herfried,

This one I didn't know of :-) Is there any difference between
controlchars.newline and environment.newline ?

Thanks



Quote:
> Hello Antonio,


> > I see that the constant vbCrLf is still valid in vb.net.
> > Is it ok to use it, or is it better to use the
> > system.environment.newline? Is there any drawback
> > on the use of old constants?

> I prefer ControlChars.NewLine.

> ;-)

> Regards,
> Herfried K. Wagner



Mon, 19 Sep 2005 12:12:06 GMT  
 New lines
Hi,

No difference.  Personally, as an OLD VB guy, I'll stick with vbCrLf.

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Mon, 19 Sep 2005 07:40:13 GMT  
 New lines
Hi Armin,

that was a great info!! I thought the vbcrlf was on the compatibility
library!!

Thanks


Quote:

> > I see that the constant vbCrLf is still valid in vb.net. Is it
> > ok to use it, or is it better to use the
> > system.environment.newline? Is there any drawback on the use of
> > old constants?

> I use vbCrlf because it's shorter and returns exactly the same as
> environment.newline (and it's *not* part of the compatibility library).

> Armin



Mon, 19 Sep 2005 12:59:51 GMT  
 New lines
It's part of the Microsoft.VisualBasic Assembly.  This is a required
Assembly by any VB.NET application.  Those functions are there for backwards
compatibility basically, so VB6 programmers can feel at home, but they're
not going away in future versions or anything like that.  Definitely safe to
use and at no performance cost.

Erik Porter
Microsoft .NET MVP
http://www.windowsforms.net


Quote:
> Hi Armin,

> that was a great info!! I thought the vbcrlf was on the compatibility
> library!!

> Thanks




> > > I see that the constant vbCrLf is still valid in vb.net. Is it
> > > ok to use it, or is it better to use the
> > > system.environment.newline? Is there any drawback on the use of
> > > old constants?

> > I use vbCrlf because it's shorter and returns exactly the same as
> > environment.newline (and it's *not* part of the compatibility library).

> > Armin



Mon, 19 Sep 2005 09:29:44 GMT  
 New lines

Quote:
> Hi,

> No difference.  Personally, as an OLD VB guy, I'll stick with vbCrLf.

Which is fine, but if/when the CLR is ported to other platforms, that would
not be portable (unless the compiler was optimizing it under the hood?)

Chris

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Mon, 19 Sep 2005 23:34:55 GMT  
 New lines


Quote:
> that.  Definitely safe to use and at no performance cost.

Are they portable in case the CLR is ever ported to another OS?

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Mon, 19 Sep 2005 23:36:08 GMT  
 New lines

Quote:


> > that.  Definitely safe to use and at no performance cost.

> Are they portable in case the CLR is ever ported to another OS?

You'd probably have to change more than that... ;-)

Armin



Mon, 19 Sep 2005 23:45:06 GMT  
 New lines
I know I read the Mono project has a VisualBasic specific assembly and i
would imagine that all the stuff that's in Microsoft.VisualBasic will be in
there.

-Erik


Quote:


> > Hi,

> > No difference.  Personally, as an OLD VB guy, I'll stick with vbCrLf.

> Which is fine, but if/when the CLR is ported to other platforms, that
would
> not be portable (unless the compiler was optimizing it under the hood?)

> Chris

> --
> If you don't like lunchmeat, please remove it from my e-mail address to
> send me an e-mail



Tue, 20 Sep 2005 02:58:44 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Textbox/label which add a new line and remove the last line

2. replace line with new line in ini file

3. Recognising New lines in memo fields imported from Excel

4. Eliminating new line characters in a field

5. Passing New Line to Textbox in Code

6. Starting a new line in text box control

7. new line in text box

8. new line in text box OFFTOPIC

9. How to get e new line in a ControlTextTip

10. How to get e new line in a ControlTextTip

11. new line breaks in text box

12. How can I add new-line characters into a customer formula

 

 
Powered by phpBB® Forum Software