In vbscript I'm trying to write a string that contains double quots as part of the content. Ex: "SqlServer2000" My vbscript is as follows:

dim String1, String
String2 = "SqlServer2000

String1 = """ & String2 & ""
WriteLine(String1

The results that I'm getting are: " & String2 & ". What I wanted is: "SqlServer2000". the quots are included as part of the variabel content. How do I make this work for me?

thank

Loui

Re: Writing a file that contains double Quots as content by Steven

Steven
Thu Apr 29 13:36:13 CDT 2004

string = chr(34) & string & chr(34)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Personal favourites

WebGrid - www.webgrid.co.uk
Freeware Arena - www.freewarearena.com
Freeware Home - www.freewarehome.com
Pricelessware - http://www.pricelessware.org
Practically Nerded - http://mvps.org/PracticallyNerded/
Bugs, Glitches n stuff - http://mvps.org/inetexplorer/Darnit.htm
Calendar of Updates - http://www.dozleng.com/updates/index.php?&act=calendar


"Louis" <anonymous@discussions.microsoft.com> wrote in message
news:344A720C-7AD7-4968-84FD-2242E38D3CF4@microsoft.com...
> In vbscript I'm trying to write a string that contains double quots as
part of the content. Ex: "SqlServer2000" My vbscript is as follows:
>
> dim String1, String2
> String2 = "SqlServer2000"
>
> String1 = """ & String2 & """
> WriteLine(String1)
>
> The results that I'm getting are: " & String2 & ". What I wanted is:
"SqlServer2000". the quots are included as part of the variabel content.
How do I make this work for me?
>
> thanks
>
> Louis
>
>
>
>



Re: Writing a file that contains double Quots as content by Viatcheslav

Viatcheslav
Thu Apr 29 13:44:19 CDT 2004

You may double quote inside string to get result:

String1 = """SqlServer2000"""

At beginning - first quote opens string, next 2 quotes represent quote
inside string
At end - 2 quotes represent quote inside string, last quote closes string

or

String1 = """" & String2 & """"
(4 quotes at every end)

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE

"Louis" <anonymous@discussions.microsoft.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:344A720C-7AD7-4968-84FD-2242E38D3CF4@microsoft.com...
> In vbscript I'm trying to write a string that contains double quots as
part of the content. Ex: "SqlServer2000" My vbscript is as follows:
>
> dim String1, String2
> String2 = "SqlServer2000"
>
> String1 = """ & String2 & """
> WriteLine(String1)
>
> The results that I'm getting are: " & String2 & ". What I wanted is:
"SqlServer2000". the quots are included as part of the variabel content.
How do I make this work for me?
>
> thanks
>
> Louis
>
>
>
>