Embedding quotes in string var ? 
Author Message
 Embedding quotes in string var ?

I am trying to embed qoute characters into a string variable
for later use when dynamically creating a page using ASP

i.e

Dim strFoo

strFoo = " <font FACE="Helvetica" SIZE="2">"

VBScript does'nt like the embedded quotes
so I tried special characters....

strFoo = " <font FACE= &quot;Helvetica&quot; SIZE=&quot;2&quot;>"

In this instance the browser (IE3.02) ignores the &qout;

I am obviously missing something simple here ,but my reference
on VBScript appears not to cover this subject

Can any kind soul enlighten me as to the problem?

All input gratefully received!

--
Patrick Howard
Cambridgeshire
England



Fri, 28 Jul 2000 03:00:00 GMT  
 Embedding quotes in string var ?

try to use 'double doublequotes':

Quote:
>strFoo = " <font FACE="Helvetica" SIZE="2">"

-->  strFoo = " <font FACE=""Helvetica"" SIZE=""2"">"


Sat, 29 Jul 2000 03:00:00 GMT  
 Embedding quotes in string var ?

I do one of two things:
use chr(34) like this:

strFoo="<font FACE=" & chr(34) & "Helvetica" & chr(34) & "SIZE=2>"

or

strFoo="<font FACE='Helvetica' SIZE='2'>"

Yep, the single quote seems to work fine everywhere the doublequote would
work as far as HTML is concered.

Scott

Quote:

>I am trying to embed qoute characters into a string variable
>for later use when dynamically creating a page using ASP

>i.e

>Dim strFoo

>strFoo = " <font FACE="Helvetica" SIZE="2">"

>VBScript does'nt like the embedded quotes
>so I tried special characters....

>strFoo = " <font FACE= &quot;Helvetica&quot; SIZE=&quot;2&quot;>"

>In this instance the browser (IE3.02) ignores the &qout;

>I am obviously missing something simple here ,but my reference
>on VBScript appears not to cover this subject

>Can any kind soul enlighten me as to the problem?

>All input gratefully received!

>--
>Patrick Howard
>Cambridgeshire
>England




Mon, 07 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to embed quotes in strings

2. Embedding Double Quotes in a String -- How?

3. Help embedding quotes in strings

4. Need to embed single quote in SQL string

5. How to embed double quote in a string?

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

7. Quote in quoted string ?

8. var = var = var

9. var = var = var

10. Quoting "Quotes" in a string variable

11. Concatenation with embedded double-quote

12. Using an embedded quote in a javascript function call parameter

 

 
Powered by phpBB® Forum Software