Copy link to clipboard
Copied
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.
Hi Klaus,
On line 12 you have a small mistake it should be like this:
oMarker = oMarker.NextMarkerInDoc;
I hope that helps?
Ian
Copy link to clipboard
Copied
Hi Klaus,
On line 12 you have a small mistake it should be like this:
oMarker = oMarker.NextMarkerInDoc;
I hope that helps?
Ian
Copy link to clipboard
Copied
Ian,
small, but powerful!