SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Apr 2004
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How do I put a quotation mark in a const string

    Hi there

    Probably an incredibly basic question, but here goes.

    How do I include a quotation mark in a string that I am declaring as a constant, e.g.

    const MyVar = "I want to "do this""

    I've tried backslash to escape the quotes but that doesn't work..

    Thanks!!

    P

  2. #2
    Junior Member
    Join Date
    Jun 2002
    Location
    Honolulu, HI, USA
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I put a quotation mark in a const string

    you may have to set up a constant and assign it a value of chr(34); ASCII 34 is the double quote. Use this constant to construct the string containing double quotes.
    for example:

    scenario "doublequote test"

    dim doublequote as string
    dim teststr as string

    doublequote = chr(34)

    teststr = "test text with, " + doublequote + "some actual quotes" + doublequote

    print teststr

    end scenario

  3. #3
    Junior Member
    Join Date
    Jan 2004
    Location
    Columbus Ohio
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I put a quotation mark in a const string

    try:
    const MyVar = "I want to ""do"" this"

  4. #4
    Junior Member
    Join Date
    Mar 2004
    Location
    Liverpool
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I put a quotation mark in a const string

    print """" + "Hello" + """"

    Gives you "Hello"

    As does this...

    print """Hello"""

    [ 04-13-2004, 03:19 AM: Message edited by: JimboJones ]

  5. #5
    Junior Member
    Join Date
    Apr 2004
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How do I put a quotation mark in a const string

    Thanks everyone, the double double quotes did the trick (makes sense..)!!

    Pat

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.68%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:17 AM.

Copyright BetaSoft Inc.