Sign in to follow this  
Followers 0
GWmellon

How to use StringReplace

2 posts in this topic

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)

Share this post


Link to post
Share on other sites



Forget it. Just figured out which clue I was missing.

If $result > 0 then

$testline2= StringReplace($testline,"Vessel Name","Bubba Smith")

endif

works fine.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0