WriteLine with <% %> and double quote signs

V

vunet.us

I create an ASP file using fso.createtextfile. But how do I avoid
double quotes and <% %> signs when writing to file?

FileAsp.WriteLine("<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252">")
FileAsp.WriteLine("<!-- #Include file="file.asp" -->")
FileAsp.WriteLine(" <% =Blah %>")

Thanks
 
B

Bob Barrows [MVP]

I create an ASP file using fso.createtextfile. But how do I avoid
double quotes and <% %> signs when writing to file?

FileAsp.WriteLine("<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252">")
FileAsp.WriteLine("<!-- #Include file="file.asp" -->")
FileAsp.WriteLine(" <% =Blah %>")

Thanks

Separate them.


FileAsp.WriteLine(" <")
FileAsp.WriteLine(" % =Blah %")
FileAsp.WriteLine(">")
 
B

Bob Barrows [MVP]

I create an ASP file using fso.createtextfile. But how do I avoid
double quotes and <% %> signs when writing to file?

FileAsp.WriteLine("<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252">")
FileAsp.WriteLine("<!-- #Include file="file.asp" -->")
FileAsp.WriteLine(" <% =Blah %>")
Oh! And if you want to write a double quote, you have to escape it by
doubling it:
FileAsp.WriteLine("<%@LANGUAGE=""VBSCRIPT"" CODEPAGE=""1252"">")
 
V

vunet.us

Separate them.

FileAsp.WriteLine(" <")
FileAsp.WriteLine(" % =Blah %")
FileAsp.WriteLine(">")

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

so source code will be:

<
% =Blah %
will it work? maybe I can use command write to append into one line?
 
B

Bob Barrows [MVP]

so source code will be:

<
% =Blah %

will it work? maybe I can use command write to append into one line?

No it won't work; but is it such a leap to change my recommendation (which
was done with writing to Response in mind) to
FileAsp.WriteLine(" <" & "%= Blah %" & ">")?

:)
 
D

Dave Anderson

I create an ASP file using fso.createtextfile. But how do I avoid
double quotes and <% %> signs when writing to file?

FileAsp.WriteLine("<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252">")
FileAsp.WriteLine("<!-- #Include file="file.asp" -->")
FileAsp.WriteLine(" <% =Blah %>")

Personally, I would do it like this:

FileAsp.WriteLine("<\%@LANGUAGE=\"VBSCRIPT\" CODEPAGE=\"1252\">")
FileAsp.WriteLine("<!-- #Include file=\"file.asp\" -->")
FileAsp.WriteLine("<\%=Blah%\>")
 
B

Bob Barrows [MVP]

Dave said:
Personally, I would do it like this:

FileAsp.WriteLine("<\%@LANGUAGE=\"VBSCRIPT\" CODEPAGE=\"1252\">")
FileAsp.WriteLine("<!-- #Include file=\"file.asp\" -->")
FileAsp.WriteLine("<\%=Blah%\>")

:) Cruel joke.
Hopefully vunet recognizes javascript vs vbscript.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top