Reproducible Error in LotusScript replace function

Replace ignores text it should replace at the beginning of source string:

This if you want to replace %2F with / in this string

%2Fsomeurl%2Fpath%2F

You will get back

%2Fsomeurl/path/

The nasty workaround is to put extra characters at start of string, and you have to put a string LONGER than your replace code. For example:

Function unEscape(source As String) As String

Dim find(1 To 4) As String

Dim repl(1 To 4) As String



find(1) = "%2F"

repl(1) = "/"

find(2) = "%3F"

repl(2) = "?"

find(3) = "%26"

repl(3) = "&"

find(4) = "%3D"

repl(4) = "="



unEscape = Mid$(Replace("xxxx" + source, find, repl, 5), 5)

End Function

Nice one IBM, words fail.

Simon

Subject: Reproducible Error in LotusScript replace function

I tested and had the same results. I even tried it using different characters, and it still had this flaw.

This is definitely something you should report to Lotus Support for a bug fix.

Subject: RE: Reproducible Error in LotusScript replace function

I would if I could. You have to have a support agreement to tell them their software is bugged.

Check out the support link to the left, you can only send info if you have paid for the privilege of debugging their software.

To be honest, I dunno how to inform them, oh and thanks for confirming that I’m not goin mad

Cheers

Simon