Forum Moderators: open

Message Too Old, No Replies

Response.Write of "

         

ukgimp

4:56 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Response.Write "<option value=&#34;" & i+1 & "&#34;>" & aOptions(i) & "</option>"

How do you write a " with ASP. I cant seem to find this anywhere and it is proving annoying :)

bakedjake

4:57 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Use two of them together.

[edited by: bakedjake at 4:59 pm (utc) on Nov. 3, 2003]

ukgimp

4:59 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



so to write a " you have to write

"""

?

Cheers Jake

bakedjake

4:59 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Exactly. :) I was confusing myself - they're already called double quotes, and I couldn't figure out how to tell you what I wanted to. :)

ukgimp

5:00 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cool

Thanks, what a response time :)

Xoc

2:09 am on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To just insert a ", you need """". The first one starts the literal string. The next two translate to a " inside the string. The final one closes the string. Confusing as heck, I know. So any time you put "" inside a string, it doesn't close it, instead it inserts one " into the string.

bakedjake

2:14 am on Nov 4, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Right, but you only use the four quotes when you want to simply output one quote, and close the string.

You'd use the two quotes inside of a string when you want to output one quote, and keep the string open (which I think was what ukgimp was doing).

ukgimp

8:41 am on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



what you trying to do to me lol

I will have to experiment now, now I have a rough idea. Why cant we just have php style

"\""

:)

TheDave

2:09 pm on Nov 4, 2003 (gmt 0)

10+ Year Member



My approach to this has always been chr(34). I go as far as const cQT = chr(34), but usually along with others like line feeds and stuff.

aspdaddy

9:50 pm on Nov 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have always used single quotes for this, simply because it works first time :)

Response.Write "<option value='" & i+1 & "'>" & aOptions(i) & "</option>"

ukgimp

8:39 am on Nov 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Response.Write "<option value=""" & i+1 & """>" & aOptions(i) & "</option>"

After a bit of experimentation. Might go with single in future but it is good to know anyhow.

cheers