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)