| View previous topic :: View next topic |
| Author |
Message |
jordis
Joined: 30 Jul 2004 Posts: 78
|
Posted: Mon Jan 31, 2005 6:07 pm Post subject: StringReplace ALL malfunction. Bug? |
|
|
Hi Chris,
I just noticed a bug in StringReplace when replacing with option ALL in files *relatively* large.
The problem is that in the last occurence of the search&replace text, Autohotkey replaces the string but the file just ends right away, regardless of the original file having more text after the occurrence.
I started with the original file I wanted to work with (~200KB) and I kept reducing it's size. With a file size of ~35KB the problem persists. With a ~17KB file, the problem does not exist. I don't know whether it's related to the number of occurrences being replaced or it's file-size related...
The code I'm using for the search&replace:
| Code: | ; read file into %htmlcomp%
FileRead, htmlcomp, FILE.htm
; replace "C:\PRO\HTML\" with nothing and all instances
StringReplace, htmlcomp, htmlcomp,C:\PRO\HTML\,,All
; write results in file2.htm
FileAppend, %htmlcomp%, FILE2.htm ; write results in file2.htm |
WORKAROUND: I realised that the problem does NOT exist in specifying "AllSlow", so I guess it's a problem with the "faster replacement method" mentioned in the StringReplace help...
If you require, I can send you the files I was working with for you to test...
Regards
jordi |
|
| Back to top |
|
 |
jordis
Joined: 30 Jul 2004 Posts: 78
|
Posted: Mon Jan 31, 2005 6:28 pm Post subject: |
|
|
Sorry, I just realised I should have posted it in "Bug reports" section...
Can you move it there? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Feb 01, 2005 1:41 am Post subject: Re: StringReplace ALL malfunction. Bug? |
|
|
| jordi wrote: | | a bug in StringReplace when replacing with option ALL in files *relatively* large. The problem is that in the last occurence of the search&replace text, Autohotkey replaces the string but the file just ends right away |
Thanks for the detailed bug report. This should have been tested better originally; hopefully I'll get back on track with better quality control in future releases.
This has been fixed in the latest update: "Fixed StringReplace (broken by v1.0.25) to work properly on large strings requiring more than 20 replacements."
As you asked, I've moved this to the bugs forum. Thanks again. |
|
| Back to top |
|
 |
jordis
Joined: 30 Jul 2004 Posts: 78
|
Posted: Tue Feb 01, 2005 2:48 am Post subject: Re: StringReplace ALL malfunction. Bug? |
|
|
| Chris wrote: | | This should have been tested better originally; hopefully I'll get back on track with better quality control in future releases. |
Well, with your flawless ongoing support and quick bug-fixing, I think you're doing great quality-control wise!
I'll let you know tomorrow (well, later today already) whether the new version works for me.
Thanks!
jordi |
|
| Back to top |
|
 |
jordis
Joined: 30 Jul 2004 Posts: 78
|
Posted: Tue Feb 01, 2005 1:35 pm Post subject: |
|
|
It works!
thanks again! |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Feb 01, 2005 3:06 pm Post subject: |
|
|
| Thanks for verifying. |
|
| Back to top |
|
 |
|