|
-
Feb 17th, 2005, 05:29 AM
#1
vbCrLf replacement in .NET (RESPOLVED)
Search...can't find anything. Booooo.
Anyone?
Woof
Last edited by Wokawidget; Feb 17th, 2005 at 05:49 AM.
-
Feb 17th, 2005, 05:31 AM
#2
Re: vbCrLf replacement in .NET
dont know if its .NET, but you can try "ControlChars.CrLf"
-
Feb 17th, 2005, 05:48 AM
#3
Re: vbCrLf replacement in .NET
Spot on! 
Cheers.
Woof
-
Feb 17th, 2005, 06:08 AM
#4
PowerPoster
Re: vbCrLf replacement in .NET (RESPOLVED)
Hi,
Why do you object to VBCrLf ?
The MSDN Help reference from VBCrLf is exactly the same as from ControlCharacters
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Feb 17th, 2005, 07:45 AM
#5
Re: vbCrLf replacement in .NET (RESPOLVED)
vbCrlf is a VB6 constant.
It comes from the System.VisualBasic namespace.
Why use soemthing in .NET that is only there for histprical reasons, and coz loads of VB6 developers whinged about it.
Woka
-
Feb 17th, 2005, 07:50 AM
#6
Re: vbCrLf replacement in .NET (RESPOLVED)
-
Feb 17th, 2005, 07:54 AM
#7
Re: vbCrLf replacement in .NET (RESPOLVED)
 Originally Posted by Wokawidget
vbCrlf is a VB6 constant.
It comes from the System.VisualBasic namespace.
Microsoft.VisualBasic 
And I hate to break it to you, but the ControlChars class is in that namespace as well.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Feb 17th, 2005, 09:21 AM
#8
Re: vbCrLf replacement in .NET (RESPOLVED)
What about the System.Environment.NewLine constant in VB.NET?
-
Feb 17th, 2005, 09:39 AM
#9
Re: vbCrLf replacement in .NET (RESPOLVED)
What?! Another method?!
Why? What? How?
Which one?!

I hate .NET
Woof
-
Feb 17th, 2005, 10:12 AM
#10
Re: vbCrLf replacement in .NET (RESPOLVED)
 Originally Posted by Wokawidget
What?! Another method?!
Why? What? How?
Which one?!
I hate .NET
Woof
It's alright to realize that you're not good enough for it.
-
Feb 17th, 2005, 10:12 AM
#11
PowerPoster
Re: vbCrLf replacement in .NET (RESPOLVED)
Hi,
You mean you hate being spoiled for choice??
They all work and VBcrlf is the shortest
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Feb 17th, 2005, 10:22 AM
#12
Re: vbCrLf replacement in .NET (RESPOLVED)
environment.newline is the best by far.. it works in places that crlf doesn't work.. like in balloon tips (possibly in tooltips.. but i didnt test them)
-
Feb 17th, 2005, 11:09 AM
#13
Re: vbCrLf replacement in .NET (RESPOLVED)
I am good enough to use .NET, which is why I am noticing their are problems you muppet 
Errrr...That's nice to know about the different methods not working in different objects Bad MS *SLAP*
So...which one to use?
vbCrLf is from VB6. I will NOT use any legacy code in .NET
Woka
-
Feb 17th, 2005, 11:28 AM
#14
-
Feb 17th, 2005, 05:05 PM
#15
Member
Re: vbCrLf replacement in .NET (RESPOLVED)
Whats wrong with VbCrLf ?
it works fine althought I agree with kleinma that Envinroment.NewLine is better.
-
Feb 17th, 2005, 05:47 PM
#16
Re: vbCrLf replacement in .NET (RESPOLVED)
 Originally Posted by apolizoi
Whats wrong with VbCrLf ?
it works fine althought I agree with kleinma that Envinroment.NewLine is better.
nothing is wrong with it (other than its limitations versus environment.newline)
but a lot of people that move to VB.NET from VB6 try to stay away from VB6 things, which are in the Microsoft.VisualBasic namespace... because they are only there to save VB6 people from having to learn everything.. I don't know of anything in the VB6 namespace that can't be accomplished another way...
-
Feb 17th, 2005, 06:07 PM
#17
Addicted Member
Re: vbCrLf replacement in .NET (RESPOLVED)
Fiddling a bit with types got me this way of doing it without Microsoft.VisualBasic :
VB Code:
Dim sTest As String
sTest = "Hello"
sTest += Convert.ToChar(13).ToString() + Convert.ToChar(10).ToString()
sTest += "How r u?"
There are no stupid questions, but a whole bunch of dumb sayings !
Save time on database code, try DataLG !
-
Feb 17th, 2005, 06:28 PM
#18
Re: vbCrLf replacement in .NET (RESPOLVED)
 Originally Posted by sixfeetsix
Fiddling a bit with types got me this way of doing it without Microsoft.VisualBasic :
VB Code:
Dim sTest As String
sTest = "Hello"
sTest += Convert.ToChar(13).ToString() + Convert.ToChar(10).ToString()
sTest += "How r u?"
yeah but look at all the methods you are using there, yo uare calling tostring and tochar twice...
stest = "Hello" & Environment.Newline & "how r u?"
would give you the same result...
-
Feb 17th, 2005, 06:38 PM
#19
Addicted Member
Re: vbCrLf replacement in .NET (RESPOLVED)
Yeah, I don't face that problem usually, cause from VB6, I went (almost) directly to C# since I am used to C and C++.
So I can use "\r\n".
Also, when I have to use VB .Net, I remove Microsoft.VisualBasic from the general Imports, and I then define a string (pseudo) constant with "Convert.ToChar(13).ToString() + Convert.ToChar(10).ToString()" when I need it.
VB Code:
Dim NL As String = Convert.ToChar(13).ToString() + Convert.ToChar(10).ToString()
Last edited by sixfeetsix; Feb 17th, 2005 at 06:44 PM.
There are no stupid questions, but a whole bunch of dumb sayings !
Save time on database code, try DataLG !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|