function PageIndexFromID(const ID: Integer): Integer;
Given a page ID, returns an position index. Call this if, for example, you want to check whether a page is positioned before a certain other page.
function ShouldSkipPage(PageID: Integer): Boolean; begin Result := PageIndexFromID(PageID) < PageIndexFromID(wpReady); end;