Highlighted

One difference between FM10/11 and later FM versions

Advocate ,
Feb 03, 2018

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

TOPICS
Scripting

Views

186

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

One difference between FM10/11 and later FM versions

Advocate ,
Feb 03, 2018

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

TOPICS
Scripting

Views

187

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 03, 2018 0
Adobe Community Professional ,
Feb 04, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 04, 2018 0