|
-
Feb 3rd, 2004, 11:39 PM
#1
Thread Starter
New Member
How to put a literal quote " in a msgbox
OK, I'm a newbie here and am just learning VB.....
I want to literally put a " (a quote) in a Msgbox...how can I get VBscript to recognize that I just want a " in the MSGbox and it is not the beginning of a string?
for example...
The following code in a .vbs file:
Msgbox "
Returns an error "unterminated string constant". But I literally want a message box with a double quote mark in it. How do you do it?
Thanks,
Bookoo
-
Feb 3rd, 2004, 11:42 PM
#2
-
Feb 3rd, 2004, 11:55 PM
#3
-
Feb 4th, 2004, 01:29 AM
#4
PowerPoster
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

-
Feb 4th, 2004, 09:27 AM
#5
Frenzied Member
Think you have to use
Msgbox """" asd """"
Originally posted by Arc
MsgBox """asdfsdfsdf"""
-
Feb 4th, 2004, 09:46 AM
#6
-= B u g S l a y e r =-
Originally posted by BrianS
Think you have to use
Msgbox """" asd """"
VB Code:
Private Sub Command1_Click()
MsgBox """" & "asd" & """"
End Sub
-
Feb 4th, 2004, 11:45 AM
#7
Or make it a constant :
VB Code:
Const Quotes As String = """"
MsgBox Quotes & "text" & Quotes
Makes it easier to read...
Has someone helped you? Then you can Rate their helpful post. 
-
Feb 4th, 2004, 12:17 PM
#8
Hyperactive Member
There are two ways to do it
First way:
msgbox "Hello ""Test"" Good bye"
Second way:
msgbox "Hello " & chr(34) & "Test" & chr(34) & " Good bye"
It will look like this:
Hello "Test" Good bye
I hope this is want you need.
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
|