Passing a doble-quote character to response.write

R

Ricardo

Hi.

How should I pass a " (doble-quote) character to
response.write() in order for it to be sent to the output ?

Thanks in advance for the help.
 
B

Bob Barrows

Ricardo said:
Hi.

How should I pass a " (doble-quote) character to
response.write() in order for it to be sent to the output ?

Thanks in advance for the help.

Double it (also known as "escaping" it):
response.write "here is a double=quote: ""<BR>"

HTH,
Bob Barrows
 
E

Evertjan.

Ricardo wrote on 08 jul 2003 in microsoft.public.inetserver.asp.general:
How should I pass a " (doble-quote) character to
response.write() in order for it to be sent to the output ?

If we are speakig about vbscript response.write argument is without ().

<%
response.write "This: "" is a single double quote.<br>"
response.write "This: """" is a double double quote.<br><br>"

response.write "This: &quot; is a single double quote.<br>"
response.write "This: &quot;&quot; is a double double quote."
%>
 
A

A Ratcliffe

Actually, VBscript doesn't seem to mind either way:

Response.Write("This is a response")
Response.Write "This is a response"

Both of those are accepted in VBScript without error.

A Ratcliffe
 
E

Evertjan.

A Ratcliffe wrote on 09 jul 2003 in
microsoft.public.inetserver.asp.general:
Actually, VBscript doesn't seem to mind either way:

Response.Write("This is a response")
Response.Write "This is a response"

Both of those are accepted in VBScript without error.

That is not the [my] point. The () however are parsed away by the
expression parser before it reaches the response.write, at the cost of some
extra processing time.

Like:

Response.Write 7.13*1*1*1

results in the same as

Response.Write 7.13

Still the first is not ordinary scripting, as it just ads something
superfluous (*1*1*1) and shows a lack of knowledge of vbscript syntax.
 
E

Evertjan.

A Ratcliffe wrote on 09 jul 2003 in
microsoft.public.inetserver.asp.general:
since they had to use the parentheses in
Conn.Execute(strSQL)

Is this true ?

I do not use that, but in vb, I shouldn't think so, if we are talking
statements, or functions used as statements, and not functions?
 
B

Bob Barrows

A said:
Personally I agree with your point, but having had to work on another
coder's scripts which did use the parentheses, I thought it worth
mentioning.

Their reasoning was that since they had to use the parentheses in
Conn.Execute(strSQL)

They did not HAVE to use parentheses, unless they were getting a recordset
back from the method:
Set rs=Conn.Execute(strSQL)


The only reason they were able to get away with using parentheses without
getting anything back:

Conn.Execute(strSQL)

was because they were only passing a single argument to the Execute method.
Try using parentheses in this more appropriate call (you really should be
telling ADO what the CommandType is instead of making it guess ...) to
Execute and see what happens:

Conn.Execute(strSQL..adCmdText)

The rule that has served me very well in the last 10 yrs is:

Only use parentheses when passing arguments to a function whose return value
is being "used".

Of course, I had to unlearn this rule when I started doing jscript, and I
understand that the rule is no longer valid in vb.net.

HTH,
Bob Barrows
 
D

Dave Anderson

Evertjan. said:
Response.Write 7.13*1*1*1

results in the same as

Response.Write 7.13

Still the first is not ordinary scripting, as it just ads something
superfluous (*1*1*1) and shows a lack of knowledge of vbscript syntax.

While I agree that multiple identity multiplications are superfluous, I
don't see how using them demonstrates lack of knowledge of VBScript syntax.
Would you suggest a different multiplication operator?

I suppose you were trying to say that Response.Write(7.13) demonstrates such
a lack. In that case, would you accept the use of

Call Response.Write(7.13)

as demonstrating knowledge of VBScript syntax? Or does your definition of
"syntax" only mean "what I'm used to seeing"?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
E

Evertjan.

Dave Anderson wrote on 10 jul 2003 in
microsoft.public.inetserver.asp.general:
Evertjan. said:
This is no question of accepting this, this is pure nonsense.

The Call statement is to use a function as a statement,

Incorrect. The Microsoft documentation describes as [Call] an "optional
keyword" of the Call Statement, which is implicit in every Sub/Function
call. In other words, it is syntactically valid.

I will forgo on your furter remarks by explaining that M$ did not invent
Basic, that it's documentation is not the Bible, nor is M$ God.

If I critisize M$ for some idea's, your telling me that M$'s changing of
the basic Basic principles in VB makes my critique incorrect, is ludicrous.

Bill Gates' own ideas, as seen in "Central Data Basic" for the Signetic's
2650 microprocessor, from around 1982, expanding the original Basic concept
into the direction of the modern VB concept, were far more sound than the
lozening of the syntax adopted nowadays by M$.
 
D

Dave Anderson

Evertjan. said:
The Microsoft documentation describes as [Call] an "optional
keyword" of the Call Statement, which is implicit in every
Sub/Function call. In other words, it is syntactically valid.

I will forgo on your furter remarks by explaining that M$ did not
invent Basic, that it's documentation is not the Bible, nor is M$
God.

We're not talking about Basic, we're talking about VBScript. And VBScript is
whatever Microsoft says it is, which makes the MS documentation 100%
relevant.
If I critisize M$ for some idea's, your telling me that M$'s
changing of the basic Basic principles in VB makes my critique
incorrect, is ludicrous.

What is ludicrous is the assertion that VBScript is Basic -- or even an
implementation of Basic. It's a separate scripting language intended to be
familiar to Basic programmers, and nothing more.
Bill Gates' own ideas, as seen in "Central Data Basic" for the
Signetic's 2650 microprocessor, from around 1982, expanding
the original Basic concept into the direction of the modern VB
concept, were far more sound than the lozening of the syntax
adopted nowadays by M$.

Start with a false pretense and you can conclude anything you desire.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top