SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Guest

    How to print string \"

    I need to Print ". I tried to use
    Print (" \" ") and got error. How to
    print this special string? Thanks.

  2. #2
    Junior Member
    Join Date
    May 2001
    Location
    Hayward, CA, USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to print string \"

    Hi
    There are two ways to do this
    The easiest is to add another double quote as in:

    Print (" here is a quote string "" ")
    However it is confusing to read

    A more elaborate method is:
    1 declare an interger to the ascii value for the double quote character, which is 34

    int iQuoteNum = 34

    2 Then use the Chr function to place the var in string variable

    string sQuote = Chr(iQuoteNum)

    Print (" here is a quote string {sQuote} ")
    These work for me
    Best
    Jerry MacPherson


    ------------------
    Pˇsky

    You can never have too many friends
    Pˇsky
    You can never have too many friends

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to print string \"

    Macman got it.

    If you don't want to confuse yourself make an constant for it.

    string q_=""""// 2 quotes in a string makes one quote.

    If you can't remember , all this is in help, under 'string' I believe.

    ------------------

  4. #4
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to print string \"

    The other way to do it is to delimit your string with single quotes (which is also supported in 4test). If you do this, then any double-quote in the string is taken as a literal double-quote, and will print accordingly.
    For example:
    ------------------

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to print string \"

    vincebowdren:

    what happens if you want to write a single-quote in your string?

    I guess you can do '"' but you won't be able to do '''.

    ------------------
    I just realized my quotes are hard to read.

    '"'= ' " '
    '''= ' ' '

    [This message has been edited by GodKnows (edited 07-09-2001).]

  6. #6
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to print string \"

    If you want a single-quote in your string, you can delimit your string with double-quotes and just use a single-quote in the body of your string. If you want to use a double-quote, then delimit the string with single-quotes.
    Admittedly if you want both then you're going to have to use one of the tricks as described above, but for the most part, I find I can get by more easily like this.

    ------------------

  7. #7
    Junior Member
    Join Date
    Oct 2000
    Location
    Cambridge MA USA
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to print string \"

    Well, you can also use concatenation to work around the quoting problem.

    This seems to work:
    When run, I got the following:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR> This has a ' in it and this has a " in it<HR></BLOCKQUOTE>

    Or there's the longer version. Silk seems to have no trouble with this string once I've created it.
    ------------------


    [This message has been edited by NigelC (edited 07-09-2001).]

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 12:48 AM.

Copyright BetaSoft Inc.