How to stop a search at the end of the flow?
Dear all,
In a document are cross references to EndNotes which are paragraphs towards the end of the document. The cross references have a distinct format ("zenref-endnote-reference").
I'm able to insert new such references as long as the current location is prior to an already existent such XRef. For this I look for the next XRef starting at the current location.
→ But how can I determine that there is no other such XRef after the current location?
The Find process just wraps at the end of the flow and finds the first XRef...
If oCurrentLoc is the current location and oFoundLoc is the result of the "Find next XRef", how can I determine whether oCurrentloc > oFoundLoc? There is no such thing as a global distance in the document (or is it?).
Any ideas are welcome!
My current idea is this:
- startPgf is the paragraph with the current location, where the Find starts
- foundPgf is the paragraph where the Find found the next XRef.
- In a loop from FirstPgfInFlow (to be determined) to LastPgfInFlow (see Re: Strange behaviour at bottom of page) I can check (by the famous ID) which one appears first.
- If it is foundPgf, then there was no further XRef after the starting location.

