GWmellon Posted September 6, 2007 Share Posted September 6, 2007 This should be straightfoward but it does not seem to work. This is what I want to do: Change "Vessel Name" in $testline to "Bubba Smith" and then to "Changed!" Which clue am I missing? $testline="<FONT FACE='Arial, sans-serif'><FONT SIZE=3>Vessel Name </FONT></FONT>" $vesselforpackslip="Changed!" MsgBox(4096,"Test of stringreplace",$testline) $result = StringInStr($testline, "Vessel Name") MsgBox(4096,"result",$result) If $result > 0 then StringReplace($testline,"Vessel Name","Bubba Smith") MsgBox(4096,"Test of stringreplace",$testline) If $result > 0 then StringReplace($testline,"Vessel Name ",$vesselforpackslip) MsgBox(4096,"Test of stringreplace",$testline) Link to comment Share on other sites More sharing options...
GWmellon Posted September 6, 2007 Author Share Posted September 6, 2007 Forget it. Just figured out which clue I was missing. If $result > 0 then $testline2= StringReplace($testline,"Vessel Name","Bubba Smith") endif works fine. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now