General XMetaL Discussion
Sebastian February 21, 2011 at 3:55 pm
Search and ReplaceFebruary 21, 2011 at 3:55 pmParticipants 3Replies 4Last Activity 11 years, 4 months ago
we have had some trouble with the Selection_object.Find.Execute([“strFind”], [“strReplace”], [“strConstraintString”], [boolMatchCase=false], [boolMatchWholeWords=false], [boolMatchPatterns=false], [boolForward=true], [boolWrap=true], [intFindReplaceAction=1], [boolSetFindDialogOptions=false]); function.
Our example: Performing a ReplaceAll action for the document content, “hello Hello”, replaceing all “hello” by “cu” case sensitve.
Selection_object.Find.Execute(“hello”, “cu”, “”, true, false, false, true, true, 3, false);
Perfoming this action XMetall/XMax replaces both “hello” and “Hello” by “cu” – it seems to ignore the case senstive flag for ReplaceAll?Derek Read February 25, 2011 at 7:25 pm
Reply to: Search and ReplaceFebruary 25, 2011 at 7:25 pm
We are aware of this issue. Affected versions that ignore the boolMatchCase parameter include:
XMetaL Author (Enterprise and Essential) 5.1.1.017
The issue was corrected with the release of XMetaL Author (Enterprise and Essential) version 6.0.1.030.
The fix should be included with the next release of XMAX.MrPaul June 10, 2013 at 6:44 pm
Reply to: Search and ReplaceJune 10, 2013 at 6:44 pm
I am experiencing some problems with the “whole words” flag for replace all as well. Can you confirm if this is also an issue (in addition to match case)?
In which version of XMAX has this been fixed? We are using XMAX version 126.96.36.199.Derek Read June 11, 2013 at 12:06 am
Reply to: Search and ReplaceJune 11, 2013 at 12:06 am
Assuming the following concrete example for XMAX 188.8.131.52, where a document contains the following text (doesn't matter where in this example):
foo test footest testfoo fotesto
The following will both replace all occurences of “test” with “blah”:
Selection.Find.Execute(“test”, “blah”, “”, true, true, false, true, false, 3, false);
Selection.Find.Execute(“test”, “blah”, “”, true, false, false, true, false, 3, false);
So, I think the answer to your question is yes. If that isn't what you are testing then please provide an example.
However, a new bug first noticed with 184.108.40.206 breaks the intFindReplaceAction argument. If you upgrade to the current release and wish to use that argument you will need to work around it with code similar to the following:
//XMetaL Script Language JScript:
var rng = ActiveDocument.Range;
var found = true;
found = rng.Find.Execute(“text to find”, “”, “”, false, false, false, true, false, 0, false);
The 4 and 5th arguments work here, while the intFindReplaceAction argument is broken.
- You must be logged in to reply to this topic.