ON FILL BUFFER block

Syntax

ON FILL BUFFER
   instruction [...]

Usage

The ON FILL BUFFER block is used to fill a page of rows into the dynamic array, based on an offset and a number of rows.

This data block is only used in DISPLAY ARRAY dialog blocks.

The ON FILL BUFFER block is executed when the runtime system needs data rows to fill the current page of the list dialog. This can happen before a BEFORE DISPLAY of a singular DISPLAY ARRAY, or before the BEFORE DIALOG block of a DIALOG / END DIALOG instruction containing DISPLAY ARRAY sub-dialogs.

The offset can be retrieved with the fgl_dialog_getbufferstart() built-in function and the number of rows to provide is defined by the fgl_dialog_getbufferlength() built-in function.
    ON FILL BUFFER
       CALL arr.clear()
       LET ofs = fgl_dialog_getBufferStart()
       LET len = fgl_dialog_getBufferLength()
       LET row = ofs
       FOR i=1 TO len
          FETCH ABSOLUTE row c1 INTO arr[i].*
          IF sqlca.sqlcode==NOTFOUND THEN
            EXIT FOR
          END IF
          LET row = row + 1
       END FOR

For more details about ON FILL BUFFER usage, see Paged mode of DISPLAY ARRAY.