General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Search and Replace
-
Sebastian February 21, 2011 at 3:55 pm
Search and Replace
February 21, 2011 at 3:55 pmParticipants 3Replies 4Last Activity 11 years, 11 months agoHey,
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 Replace
February 25, 2011 at 7:25 pmWe are aware of this issue. Affected versions that ignore the boolMatchCase parameter include:
XMAX 5.1.1.049
XMetaL Author (Enterprise and Essential) 5.1.1.017
XMAX 6.0.0.149The 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 Replace
June 10, 2013 at 6:44 pmI 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 6.0.0.159.Derek Read June 11, 2013 at 12:06 am
Reply to: Search and Replace
June 11, 2013 at 12:06 amAssuming the following concrete example for XMAX 6.0.0.159, 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 7.0.0.111 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;
rng.MoveToDocumentStart();
var found = true;
while(found) {
found = rng.Find.Execute(“text to find”, “”, “”, false, false, false, true, false, 0, false);
if(found) {
rng.TypeText(“replacement text”);
}
}The 4 and 5th arguments work here, while the intFindReplaceAction argument is broken.
-
AuthorPosts
- You must be logged in to reply to this topic.