Search and replace that crosses item boundaries?
-
- Posts: 131
- Joined: Mon Aug 29, 2005 12:03 pm
Search and replace that crosses item boundaries?
Hi there,
Earlier this year, DavidRM and Michael Pro developed and bugfixed some code for effective search and replace which is more unicode-friendly than SearchText, and which can span item boundaries. This was the discussion where the code was posted and worked out:
http://www.trichview.com/forums/viewtop ... ch+replace
I also noticed you've recently released a new version with better Unicode support:
http://www.trichview.com/forums/viewtop ... ght=search
I'm wondering if this new version includes searching across item boundaries? If not, do you plan to implement that?
Best regards,
Martin
Earlier this year, DavidRM and Michael Pro developed and bugfixed some code for effective search and replace which is more unicode-friendly than SearchText, and which can span item boundaries. This was the discussion where the code was posted and worked out:
http://www.trichview.com/forums/viewtop ... ch+replace
I also noticed you've recently released a new version with better Unicode support:
http://www.trichview.com/forums/viewtop ... ght=search
I'm wondering if this new version includes searching across item boundaries? If not, do you plan to implement that?
Best regards,
Martin
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 131
- Joined: Mon Aug 29, 2005 12:03 pm
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 42
- Joined: Wed Feb 28, 2007 4:14 am
I'm still experiencing some problems with this procedure - it's incorrectly analizes table items.
I'll workaround with this trouble for a few days - if there gonna be any improvments, I'll tell you about bugfixes.
To avoid bugs with tables, I've made a dummy IF-statement
I think, that in few days I gonna fix this problem at all.
Actually, problem is in DavidRM function in next branch
In case of table cells we need to make recursive move inside the table cells.
I'll workaround with this trouble for a few days - if there gonna be any improvments, I'll tell you about bugfixes.
To avoid bugs with tables, I've made a dummy IF-statement
Code: Select all
if styleNo = -60 then
continue;
Actually, problem is in DavidRM function in next branch
Code: Select all
else
begin
if styleNo = -60 then // my dummy fix
continue; // my dummy fix
item:=rvData.GetItem(ii);
storeSub:=nil;
subRVData:=TCustomRVFormattedData(item.GetSubRVData(storeSub,rvdFirst));
if subRVData<>nil then
begin
Result:=DoSearchTextUnicodeInItem(item,storeSub,subRVData,searchText);
if Result then
Exit;
end;
end;
Does the above code work ok for normal ASCII text, not Unicode?
Will it let me do a search from the current cursor position to the end of the file?
What happens when you locate a string that spans item boundaries, and you replace it? Does it create a new separate item?
Do you just use InsertText to do the replacement?
Will it let me do a search from the current cursor position to the end of the file?
What happens when you locate a string that spans item boundaries, and you replace it? Does it create a new separate item?
Do you just use InsertText to do the replacement?
-
- Posts: 42
- Joined: Wed Feb 28, 2007 4:14 am
Well, the author of contributed function is DavidRM - I've only fixed one very nasty bug. If you've got some questions - I could help you, but as tester, not the author - some moments in source text aren't clear to me too.
You could simply create test project and run it on your native settings.
would help you set all options.
In spite of "complete-source-using-without-source-analyze" I've tested this function a numerous times - it excellently works in my ASCII-project.toolwiz wrote:Does the above code work ok for normal ASCII text, not Unicode?
You could simply create test project and run it on your native settings.
Yes, the last parametertoolwiz wrote:Will it let me do a search from the current cursor position to the end of the file?
Code: Select all
flags: TSTUFlags
Yes, I'm using InsertText function. It creates one common item with common style.toolwiz wrote:What happens when you locate a string that spans item boundaries, and you replace it? Does it create a new separate item?
Do you just use InsertText to do the replacement?
Michael Pro, Would you mind pasting the ENTIRE FUNCTION here?
I've got pieces from three different messages that I tried to merge, and the compiler is saying there are variables that aren't being used that are part of fixes people have posted. I'm sure others are are will run into similar problems.
(Is there a section where full text of code like this are located? Or just individual message?)
Thanks
-David
I've got pieces from three different messages that I tried to merge, and the compiler is saying there are variables that aren't being used that are part of fixes people have posted. I'm sure others are are will run into similar problems.
(Is there a section where full text of code like this are located? Or just individual message?)
Thanks
-David