Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Markers can be found, but are undefined

Community Expert ,
Aug 05, 2019 Aug 05, 2019

Dear all,

File https://daube.ch/zz_tests/Endnotes-simulated.mif contains markers of type Cross-Ref which all can be found with Find dialogue or a corresponding script.

I wanted to replace this method by using a while loop with NextMarkerInDoc.

But after the first iteration the next marker is considered undefined (it would be the first relevant one).

What is going on here?

The output of the script (FM-15) below is this:

Type.Name: Cross-Ref

MarkerText: 39380: 1Heading: Gugus-file1

NextMarker: 1

NextMarkerText: 37202: zen-endnote: 1 Just a footnote with some local formatting.

#target framemaker

var oDoc = app.ActiveDoc;

  TestMarkers (oDoc);

function TestMarkers (oDoc) { // =======================================

var oMarker = oDoc.FirstMarkerInDoc;

  while (oMarker.ObjectValid()) {

    $.writeln("\n Type.Name: " + oMarker.MarkerTypeId.Name);

    $.writeln("MarkerText: " + oMarker.MarkerText);

    $.writeln("NextMarker: " + oMarker.NextMarkerInDoc.ObjectValid());

    $.writeln("NextMarkerText: " + oMarker.NextMarkerInDoc.MarkerText);

    oMarker = oDoc.NextMarkerInDoc;

  }

} //--- end TestMarkers 

Same effect also in FM-12.

TOPICS
Scripting
831
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Aug 05, 2019 Aug 05, 2019

Hi Klaus,

On line 12 you have a small mistake it should be like this:

oMarker = oMarker.NextMarkerInDoc;

I hope that helps?

Ian

Translate
Enthusiast ,
Aug 05, 2019 Aug 05, 2019

Hi Klaus,

On line 12 you have a small mistake it should be like this:

oMarker = oMarker.NextMarkerInDoc;

I hope that helps?

Ian

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 05, 2019 Aug 05, 2019
LATEST

Ian,

small, but powerful!

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