Results 1 to 7 of 7

Thread: Quotes within quotes?? HOW?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    14

    Post

    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

  2. #2
    Lively Member
    Join Date
    May 1999
    Location
    Atlanta, GA
    Posts
    75

    Post

    You could write:

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

    Jay D Zimmerman

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    You might also try:

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

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    14

    Post

    thanx for the tip with the chr$(34)

    helps me a lot now

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

  5. #5
    Guest

    Post

    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.

  6. #6
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Yeah!
    i always use a Const

    mainly for including variables in SQL strings
    Code:
    Const Quote = """"
    
    Text1.Text = "to qoute the philosopher, he said " & Quote & " I am COW!" & Quote

  7. #7
    Addicted Member
    Join Date
    Sep 1999
    Posts
    154

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width