PDA

Click to See Complete Forum and Search --> : Quotes within quotes?? HOW?


moocow
Jan 11th, 2000, 03:41 AM
Well i've been prolonging this question and doing it the hard way long enuff. How do i put a ( " ) within a textbox in code here's what i mean

Text1.text = "to qoute the philosopher, he said "I am COW!" "

see right now VB wants to count the two quotation marks around what the philosopher said but i want that to be a part of the sentence and not a break in the string. Get it? it's kinda hard to explain it further so i hope people can understand.

THANX!

------------------
MooCow

Janitor
Jan 11th, 2000, 03:46 AM
You could write:

Text1.text = "to qoute the philosopher, he said ""I am COW!"""

Jay D Zimmerman

JHausmann
Jan 11th, 2000, 03:59 AM
You might also try:

Text1.text = "to quote the philosopher, he said " & chr$(34) & "I am COW! " & chr$(34)

moocow
Jan 11th, 2000, 04:12 AM
thanx for the tip with the chr$(34)

helps me a lot now :)

------------------
MooCow

Jan 11th, 2000, 08:27 PM
Yopu could also assign it to a variable which allows easy use throughout the program:

strQuote = ChrW(34)

.........

strOut = strQuote & "To be or not to be....." & strQuote


------------------
Boothman
There is a war out there and it is about who controls the information, it's all about the information.

Mark Sreeves
Jan 11th, 2000, 09:29 PM
Yeah!
i always use a Const

mainly for including variables in SQL strings

Const Quote = """"

Text1.Text = "to qoute the philosopher, he said " & Quote & " I am COW!" & Quote

Steve Thomas
Jan 11th, 2000, 10:55 PM
If you are trying to run code and need to define a variable within a string you can do this:

Dim sStr as string
Dim sStr2 as string

sStr2 = "HI THERE"
sStr = "I Would Like to Say '" & sStr2 & "'"

Notice I have a single "Tick" right before the end quote and right after the sStr2.

I dont know if this is what your looking for but good luck.