Hi, everybody! I would like to ask for your helps to solve this problem -- How to add new line in MessageBox, using VB 2005. i try using '&vbnewline&' , but still can't work.
Add New Line in MessageBox
Collapse
X
-
-
Originally posted by KalupaPalukuHi, everybody! I would like to ask for your helps to solve this problem -- How to add new line in MessageBox, using VB 2005. i try using '&vbnewline&' , but still can't work. -
Originally posted by KalupaPalukuHi, everybody! I would like to ask for your helps to solve this problem -- How to add new line in MessageBox, using VB 2005. i try using '&vbnewline&' , but still can't work.Comment
-
Originally posted by pureenhanoivbNewLine maybe special character used in files. To add new line in msgbox, let the message text = "The first line text" & vbCrLf & " The second line text"
Let's face it, unless you've been dealing with computers for a while, Cr and Lf don't mean anything. As a result, VbCrLf just looks like a random jumble of letters. A meaningful name is much easier to remember.Comment
-
Originally posted by Killer42Let's face it, unless you've been dealing with computers for a while, Cr and Lf don't mean anything. As a result, VbCrLf just looks like a random jumble of letters. A meaningful name is much easier to remember.Comment
-
Originally posted by pureenhanoiI dont think Cr and Lf is a random jumble of letters. Cr = Carriage Return; Lf = Line Feed; those are common words used in info-tech.
As an analogy, anywhere you use the letter "A", you could also use Chr(65) - but why would you?Comment
-
Originally posted by Killer42My point was that while you and I know that, a newbie is more likely to recognise what "newline" means. It's just simpler, that's all.
As an analogy, anywhere you use the letter "A", you could also use Chr(65) - but why would you?
Your example about "A" character and Chr(65), thats was not perfect. "A" is the mainly used character, Chr(65) is coding used, while vbCrLf is mainly used to break text(i belive that) and vbNewLine is mainly used in breaking line in file.
They are diffrent and cannot to be compared.
And, some time, use Chr() making program work well, while use intrinsic character making program goes fault.
Example:
you need send parameter for a shell command. If parameter has some Space, so you must quote it by ( " ) charater. But ( " ) character is used to quote string in Vb, so you must use Chr(34) instead of ( " ) in parameter when sending.Comment
-
I still stand by what I said. Given two alternatives that produce the same result, you might as well use the one that's easier to read, especially for newbies.
And you example is also flawed.It is perfectly simple to include double quotes in a string (or parameter) which is delimited by the same character. For example Debug.Print Ucase("This string has a ""quote"" character or two in it.")Comment
-
Originally posted by Killer42It is perfectly simple to include double quotes in a string (or parameter) which is delimited by the same character. For example Debug.Print Ucase("This string has a ""quote"" character or two in it.")
Example:
I think
Text = "Filename is """+fname+" ""."
looks much worse than
Text = "Filename is "+chr(34)+fname +chr(34)+"."
The first line looks more like a random collection of text and speech-marks. The second one
lets you easily see the separate parts.
Anyway, we're kinda getting off-topic here.
In response to 'Add New Line in MessageBox', I don't use VB2005, so I can't help. But I would stand by using vbCrLf (or vbNewline, although I didn't know about that constant until a few minutes ago when I read it here - I'm more used to using CR and LF from other languages. Or just chr(13) and chr(10).
I do have a related question though. How can you put a new-line inside a ToolTip? I've tried many combinations of CR, LF, \n, /n... all to no avail. This is on VB6 by the way.Comment
-
-
Originally posted by Killer42I still stand by what I said. Given two alternatives that produce the same result, you might as well use the one that's easier to read, especially for newbies.
And you example is also flawed.It is perfectly simple to include double quotes in a string (or parameter) which is delimited by the same character. For example Debug.Print Ucase("This string has a ""quote"" character or two in it.")
I want send an command through COM port. The command need ending with Chr(13) & Chr(10).
Dim atCommand As String
is this yours idea: atCommand = "at+cmgs=""0914 450513"" & Chr(13) & Chr(10)
and this is my idea: atCommand= "at+cmgs=" & Chr(34) & "0914450513 " & Chr(34) & Chr(13) & Chr(10)
Your code will not return the desire resultComment
Comment