AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

StringReplace ALL malfunction. Bug?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Mon Jan 31, 2005 6:07 pm    Post subject: StringReplace ALL malfunction. Bug? Reply with quote

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
View user's profile Send private message
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Mon Jan 31, 2005 6:28 pm    Post subject: Reply with quote

Sorry, I just realised I should have posted it in "Bug reports" section...
Can you move it there?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Feb 01, 2005 1:41 am    Post subject: Re: StringReplace ALL malfunction. Bug? Reply with quote

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
View user's profile Send private message Send e-mail
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Tue Feb 01, 2005 2:48 am    Post subject: Re: StringReplace ALL malfunction. Bug? Reply with quote

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
View user's profile Send private message
jordis



Joined: 30 Jul 2004
Posts: 78

PostPosted: Tue Feb 01, 2005 1:35 pm    Post subject: Reply with quote

It works!
thanks again!
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Feb 01, 2005 3:06 pm    Post subject: Reply with quote

Thanks for verifying.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group