The page sequence of a form is determined by:
the Next page attribute of the page node,
the volume of data to be displayed and the space available in the main window (see Processing a Form),
During form processing the system maintains internal counters, which you can use to display the current page number.