[thelist] ASP, FSO Replace

David.Cantrell at Gunter.AF.mil David.Cantrell at Gunter.AF.mil
Tue Feb 4 15:00:20 CST 2003


>Replace strCombo, "<option value=""1718"">","<option selected

IIRC, try this:

	Replace strCombo, "<option value="""1718""">", "<option selected
value="""1718""">"

You triple-double-quote to escape a literal double-quote. Or alternately you
can do this:

	Replace strCombo, "<option value=" & Chr ( 34 ) & youVarHere & Chr (
34 ) & ">", _
	"<option selected value=" & Chr ( 34 ) & yourVarHere & Chr ( 34 ) &
">"

Probably best to go with the latter, though it is longer, because you won't
trip over embedded quotes.

Any time you run into something like this, you should trace the output. You
can trace it by response.writing it to the screen.

Long long ago, in a galaxy far, far away, I downloaded Woric's TraceLog
component. This is/was a COM component with which you do something like
this:

	dim Trace : Set Trace = Server.CreateObject (
"TheTraceLogComponentID" )
	Trace.Write "Updating strCombo..."
	Trace.Write "strCombo initial state: " & strCombo
	Replace strCombo, oldValue, newValue
	Trace.Write "strCombo final state: " & strCombo
	Set Trace = Nothing

Then you can fire up a watch window (trace.exe I believe) and watch the
trace statements spew forth in real-time.

Unfortunately the site seems to no longer exist:
http://webboy.net/tracelog/  :(

Sad, because it really helped me out a lot, and I think it could help a lot
of other folks too. Much better than response.write, anyway!

-dave



More information about the thelist mailing list