The help of UltraEdit contains the page Edit Macro command which explains the command GotoBookMark as follows:
Parameter: Index of bookmark to jump to or -1 to go to next bookmark
Description: Jump to the next/specified bookmark. The indexes start with 0. If a user enters an index that is greater than the actual number of bookmarks then it is automatically directed to the first bookmark (index 0).
Well, this explanation is not complete and of course also no correct.
GotoBookMark -1 is like using Search - Bookmarks - Next Bookmark. That's easy.
When using a bookmark index the behavior is more difficult to understand.
The bookmarks are indexed starting with 0 simply by their existence from top to bottom. For example if you set a bookmark first on line 5, next on line 20 and last on line 12, the bookmark on line 5 has index 0, the bookmark on line 12 has index 1 and the bookmark on line 20 has index 2. If the bookmark on line 12 is removed, the bookmark on line 5 has still index 0, but the bookmark on line 20 has now index 1.
If GotoBookMark 2 is used and the active file has at least 3 bookmarks, the caret is moved to the third bookmarked line. But there is one exception. If the caret is already at third bookmarked line, the caret is moved to first bookmarked line. I don't know the reason for this exception. It does not really make sense for me. I don't have any idea how to prevent the positioning of the caret on first bookmarked line if caret is already on correct bookmarked line.
If GotoBookMark 5 is used, but the active file has for example only 3 lines bookmarked, the command is interpreted like GotoBookMark -1 which means like executing Next Bookmark. So the description is wrong for this error scenario.
I will send a report to IDM about wrong description and also find out if a too large bookmark index resulted also in older versions of UltraEdit in a Next Bookmark behavior.