hemancuso
18th August 2005 19:49 UTC
possible WordReplace/WordAdd bug
It seems there is a bug in WordReplace/WordAdd which does not allow a replacement/deletion of a word to happen when the matching pattern is at the beginning of the string.
for instance:
with $0 being "testing123"
${un.WordReplace} $0 "test" "" "+" $0
after this call, $0 remains testing123
however,
${un.WordReplace} $0 "ing1" "" "+" $0
$0 becomes "test23"
I have the same problem when I try to remove a string using wordadd. It is entirely possible I'm calling these functions incorrectly, but I have spent a while trying to get them to work and am unable to.
Instructor
19th August 2005 10:03 UTC
You are right. Interesting that "test" in next examples deletes. I'll fix it, thanks.
${WordReplace} "testing123" "test" "" "+1" $0
#or
${WordReplace} "testing123" "test" " " "+" $0
P.S.
Can you reproduce bug of WordAdd
hemancuso
19th August 2005 16:36 UTC
when $0 is "testing123"
${WordAdd} $0 "" "-test" $0
$0 remains "testing123"
${WordAdd} $0 "" "-ing" $0
$0 becomes "test123"
Instructor
19th August 2005 17:07 UTC
WordAdd can't take empty delimiter. Is your example correct?
${WordAdd} "testing123" "" "E-ing" $0
$0 == "1" (delimiter is empty)
hemancuso
20th August 2005 04:34 UTC
I was attempting to remove the first item from a comma deliminated list
when $0 is "test,something,other,no"
${WordAdd} $0 "," "-test" $0
fails, at least for me.
Instructor
20th August 2005 06:31 UTC
I have tested it and all ok. (output: "something,other,no")
fails, at least for me.
How fails?