Copy link to clipboard
Copied
Dear friends with the sharp eyes and clear thoughts:
I'm puzzled. I have this piece of code (get the full script and the test document from here😞
foundTR = oDoc.Find(tloc, oFindParams); // find footnote anchor (FN ref)
while (foundTR.beg.obj.ObjectValid()) {
oFnTI = oDoc.GetTextForRange (foundTR, Constants.FTI_FnAnchor);
for (k = 0; k < oFnTI.length; k++) { // k always 0 nevertheless loop necessary!
oTL = oFnTI
.obj.TextLoc; // Location of the footnote anchor (beg) $.writeln ("¶ format; FN ref: " + oTL.obj.Name +"; "+ oObject.FnAnchorString);
$.bp(true);
if (CheckXRef (oDoc, oTL, sXRefFmt)) { // is there an XRef prior to FN anchor?
tloc = oTL;
tloc.offset += 2; // behind the FN ref
break; // continue; // already an XRef inserted
} else {
$.writeln("\tNew FN found\n");
}
}
foundTR = oDoc.Find(tloc, oFindParams);
oDoc.TextSelection = foundTR; // DEBUG
}
I have text constructs like this:
Status of the Data Browser is when I am on line 17 of the above snippet:
Wo liegt der hund begraben?
I am not sure what is happening here, but I don't always trust the Find method, especially with multiple finds. I would replace your first find with a loop:
var fn;
fn = doc.FirstFnInDoc;
while (fn.ObjectValid () === 1) {
//...
fn = fn.NextFnInDoc;
}
Copy link to clipboard
Copied
I am not sure what is happening here, but I don't always trust the Find method, especially with multiple finds. I would replace your first find with a loop:
var fn;
fn = doc.FirstFnInDoc;
while (fn.ObjectValid () === 1) {
//...
fn = fn.NextFnInDoc;
}
Copy link to clipboard
Copied
Rick, You are an angle!
I was so stupid not to recognise the linked lists as the main (and reliable) mechanism and drifted into the swamps. When I saw your answer, I suddenly thinked of the Amish People who have this wunderful song "Simple Things"...