Embedding Double Quotes in a String -- How? 
Author Message
 Embedding Double Quotes in a String -- How?

Hi Everyone,

I'm using MS Quickbasic 4.5 and I'm trying to embed double quote marks within
a string literal.  In other languages (e.g. COBOL), I can embed double quotes
by putting three of them in the middle of the string, like this:
       FIELD1 = "ABC"""DEF"   would print as ABC"DEF

       Any ideas?

       Thanks!

       John MacLerran



Sat, 29 Jun 1996 07:50:13 GMT  
 Embedding Double Quotes in a String -- How?
: Hi Everyone,

: I'm using MS Quickbasic 4.5 and I'm trying to embed double quote marks within
: a string literal.  In other languages (e.g. COBOL), I can embed double quotes
: by putting three of them in the middle of the string, like this:
:        FIELD1 = "ABC"""DEF"   would print as ABC"DEF

:        Any ideas?

:        Thanks!

:        John MacLerran

Quite easy, thought inconvenient.  You use CHR$(n) where n is the ascii
number of the double quote.  It's in the help system somewhere.  In
qbasic its under contents, ascii character table.



Sat, 29 Jun 1996 11:58:01 GMT  
 Embedding Double Quotes in a String -- How?
Quote:
>>I'm using MS Quickbasic 4.5 and I'm trying to embed double quote marks
>>within a string literal.  
>Quite easy, thought inconvenient.  You use CHR$(n) where n is the ascii
>number of the double quote.

Correct, the ASCII code is 34, so to assign ABC"DEF to FIELD1$, the proper
command would be:
        FIELD1$= "ABC" + CHR$(34) + "DEF"

--



Sat, 29 Jun 1996 14:01:41 GMT  
 Embedding Double Quotes in a String -- How?
I think I remember it was "ABC""DEF" on the Spectrum... (only 2 double quotes)
maybe you can try, who knows...


Sun, 30 Jun 1996 01:26:27 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to embed double quote in a string?

2. How to embed both single and double quotes in strings

3. Concatenate string with single and double quotes

4. working with strings containing single- and double-quotes

5. Filter-string with single/double quotes in Restrict/Find method

6. setting a string equal to double quotes

7. Double quotes in string

8. Simple string and double quote question...

9. How to use " (double-quote) in string

10. double quotes character in a string

11. Quick question about double quotes in text strings?

12. Double Quote/Apostropie in strings

 

 
Powered by phpBB® Forum Software