What is the Paged mode?

The paged mode allows a program to display a very large number of rows without copying all the rows into the program array at once. The program array holds only the current visible page.

A "page" of data is the total number of rows of data that can be displayed in the form at one time. The length of a page can change dynamically, since the user has the option of resizing the window containing the form. The runtime system automatically keeps track of the current length of a page.

The ON FILL BUFFER clause feeds the DISPLAY ARRAY instruction with pages of data. The following built-in functions are used in the ON FILL BUFFER clause to provide the rows of data for the page:

  • FGL_DIALOG_GETBUFFERSTART() - retrieves the offset in the SCROLL CURSOR result set, and is used to determine the starting point for retrieving and displaying the complete rows.
  • FGL_DIALOG_GETBUFFERLENGTH() - retrieves the current length of the page, and is used to determine the number of rows that must be provided.

The statements in the ON FILL BUFFER clause of DISPLAY ARRAY are executed automatically by the runtime system each time a new page of data is needed. For example, if the current size of the window indicates that ten rows can be displayed at one time, the statements in the ON FILL BUFFER clause will automatically maintain the dynamic array so that the relevant ten rows are retrieved and/or displayed as the user scrolls up and down through the table on the form. If the window is re-sized by the user, the statements in the ON FILL BUFFER clause will automatically retrieve and display the new number of rows.