View Single Post
  #7 (permalink)  
Old April 14th, 2009, 07:10 PM
Old Pedant Old Pedant is offline
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Philip is of course right.

Your error has *NOTHING* to do with the REPLACE call.

Your error is on *THIS* line:
Code:
strMyVariable = "NEW Craftsman Microtork 3/8" Torque Wrench"
Just create an ASP page with *ONLY* that line in it. Nothing more:
Code:
<%
strMyVariable = "NEW Craftsman Microtork 3/8" Torque Wrench" 
%>
You *WILL* get a COMPILER error. And when you get a compiler error, that means the code will not even *BEGIN* to run. You must get rid of all compiler errors before a page can even start to make calls to functions like REPLACE.

So listen to the advice you have been given. *IT IS CORRECT*.

BUT...

But do *NOT* listen to the suggestions that you do
Code:
strMyVariable = Replace(strMyVariable, Chr(34), Chr(39))
If you do that, your MsgBox would then display
Quote:
NEW Craftsman Microtork 3/8' Torque Wrench
And I am SURE that you don't want a 3/8 of a FOOT torque wrench.

Last edited by Old Pedant; April 14th, 2009 at 07:14 PM..
Reply With Quote