theThirdElement
Programmer
Hello,
While reading the latest thread about code references, my colleague is having some weird things happening with "replace" in "Code Reference". After some investigations I realised it's probably a bug in VFP's code reference program.
It looks like that if there are repeated matching phrase in a line, and as VFP replaces, it won't update the line as one replacement is done. So it'll just keep doing replacements on one after the other without realising the indices, which indicate the beginning of the matching phrases, have changed.
Example:
Create a new form, and in some method, put in
"sentence for replacement...replacement...replacement"
(without the quotes, and ignore the syntax error
)
Then use code reference to look for the string "replacement", good, it finds it and then let's replace the string to "rep"....the code reference reports that it's done successfuly, but I get the following result after going to the code:
sentence for rep...replacemrepcementrep
There we go. Is anyone else getting the same bug?
Ed
While reading the latest thread about code references, my colleague is having some weird things happening with "replace" in "Code Reference". After some investigations I realised it's probably a bug in VFP's code reference program.
It looks like that if there are repeated matching phrase in a line, and as VFP replaces, it won't update the line as one replacement is done. So it'll just keep doing replacements on one after the other without realising the indices, which indicate the beginning of the matching phrases, have changed.
Example:
Create a new form, and in some method, put in
"sentence for replacement...replacement...replacement"
(without the quotes, and ignore the syntax error
Then use code reference to look for the string "replacement", good, it finds it and then let's replace the string to "rep"....the code reference reports that it's done successfuly, but I get the following result after going to the code:
sentence for rep...replacemrepcementrep
There we go. Is anyone else getting the same bug?
Ed