Copy link to clipboard
Copied
Dear all,
I want to inform you that there is a subtle difference in the Find function between scripts for FM-10/11 and the later FM versions.
See the relevant script part (function CollectVarsInDoc, line 50):
oTR = oDoc.Find(oTR.beg, findParams); // prepare for next find
While this is OK in the newer FM version, in FM-10/11 it creates a loop at the first found variable.
For all FM version the following is correct:
oTR = oDoc.Find(oTR.end, findParams); // prepare for next find
Klaus
Copy link to clipboard
Copied
Hi Klaus,
It may have something to do with the FS_FindWrap parameter. The default is true, so the find always wraps around and I wonder if this is what causes the loop. Here is the description from the FDK Reference Manual.
A BoolT flag that determines whether the find operation will wrap when it reaches the location where the search began. Default is True; the find operations wraps. If False, after reaching the location where the search began, the find operation returns an empty F_TextRangeT and FA_errno is set to FE_NotFound.
Rick