Skip to main content
K.Daube
Community Expert
Community Expert
February 3, 2018
Question

One difference between FM10/11 and later FM versions

  • February 3, 2018
  • 1 reply
  • 330 views

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

This topic has been closed for replies.

1 reply

frameexpert
Community Expert
Community Expert
February 4, 2018

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

www.frameexpert.com