Hello,

I am trying to use the response.write method and I have two simple
questions.

Why do I see it two forms of response.write?
1. Response.write("<HTML CODE>")
2. Response.write "<HTML CODE>" (sometimes with "(" sign and sometimes
without)

Second question:
Using this method you need to use quotation marks at start and at the
end. What if my HTML code uses quotation itself? Can I have something
like that
Response.Write("<FONT face="Geneva, Arial, Helvetica" size=2>")
The problen is how will the server know which " sign is the last one?

Is there any article about this subject or something?

Thanks in advance

Re: How to use response.write (quotation problem) please help! by Newt

Newt
Fri Aug 13 08:19:30 CDT 2004

I would normally use
response.write "<HTML code>"

In general, you either do
function param1,param2,...,paramn
or
return_value = function(param1,param2,...,paramn)

I can't remember if vbscript is as strict about this as VB is.

As for question 2,
Response.Write "<FONT face=""Geneva, Arial, Helvetica"" size=2>"

where the quotes are doubled up.

Newt

"E.U." <eli.uzan@gmail.com> wrote in message
news:c2125bcf.0408130509.51746bde@posting.google.com...
> Hello,
>
> I am trying to use the response.write method and I have two simple
> questions.
>
> Why do I see it two forms of response.write?
> 1. Response.write("<HTML CODE>")
> 2. Response.write "<HTML CODE>" (sometimes with "(" sign and sometimes
> without)
>
> Second question:
> Using this method you need to use quotation marks at start and at the
> end. What if my HTML code uses quotation itself? Can I have something
> like that
> Response.Write("<FONT face="Geneva, Arial, Helvetica" size=2>")
> The problen is how will the server know which " sign is the last one?
>
> Is there any article about this subject or something?
>
> Thanks in advance



RE: How to use response.write (quotation problem) please help! by CarolynSpeakman

CarolynSpeakman
Fri Aug 13 08:19:03 CDT 2004

I'm not sure about the first question, but with regards to question 2, if
your html uses quotes you need to put in 2 quotes in place of one. e.g.

Response.Write("<FONT face=""Geneva, Arial, Helvetica"" size=2>")

Also if you need to but a variable in there you would use:

fonts = "Geneva, Arial, Helvitica"
Response.Write("<FONT face=""" & fonts & """ size=2>")

Hope that helps.
Carolyn

"E.U." wrote:

> Hello,
>
> I am trying to use the response.write method and I have two simple
> questions.
>
> Why do I see it two forms of response.write?
> 1. Response.write("<HTML CODE>")
> 2. Response.write "<HTML CODE>" (sometimes with "(" sign and sometimes
> without)
>
> Second question:
> Using this method you need to use quotation marks at start and at the
> end. What if my HTML code uses quotation itself? Can I have something
> like that
> Response.Write("<FONT face="Geneva, Arial, Helvetica" size=2>")
> The problen is how will the server know which " sign is the last one?
>
> Is there any article about this subject or something?
>
> Thanks in advance
>

Re: How to use response.write (quotation problem) please help! by Evertjan

Evertjan
Fri Aug 13 08:33:03 CDT 2004

E.U. wrote on 13 aug 2004 in microsoft.public.scripting.vbscript:
> Why do I see it two forms of response.write?
> 1. Response.write("<HTML CODE>")
> 2. Response.write "<HTML CODE>"

[The below only is for VBscript, of course !!!]

The second one is the correct one. The first one works. The parser of the
argument has to make an extra useless step loosing the ().

A statement, or a function used as a statement, van have one or several
arguments. the arguments are separated with a comma.

so:
myStatement "argument1", myString, 6, number
is correct if myStatement has 4 arguments.

However
myStatement ("argument1", myString, 6, number)
gives an error.

This can be done:
myStatement ("argument1"), (myString), (6), (number)
but is not very useful.

That is why 1 argumental statements like:
Response.write ("litteral string")
work.

That's why the parser of the argument has to make
that extra useless step loosing the ().

====================

However a function
result = myFunction("argument1", myString, 6, number)
needs the () and many programmers think wrongly, IMHO,
that that is why the () are also necessary in a statement.
They surly will make errors with a statement with multiple arguments!

> Second question:
> Using this method you need to use quotation marks at start and at the
> end. What if my HTML code uses quotation itself? Can I have something
> like that
> Response.Write("<FONT face="Geneva, Arial, Helvetica" size=2>")
> The problen is how will the server know which " sign is the last one?

A double quote in a quoted string should be doubled

myString = "This is a quotation mark: "", Isn't it?"

> Is there any article about this subject or something?

All these are very basic questions,
which answers can be found all over this NG and on the web.
Read this NG's archives with google groups.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)