ui.Dialog.setArrayLength

Sets the total number of rows in the specified list.

Syntax

setArrayLength(
   name STRING,
   len INTEGER )
  1. name is the screen array name.
  2. len is the new size of the array.

Usage

The setArrayLength() method is used to specify the total number of rows when using the DISPLAY ARRAY paged mode. The name of the screen array is passed to identify the list, followed by an integer expression defining the number of rows.

When using a dynamic array without paged mode (i.e. without the ON FILL BUFFER clause), you don't need to specify the total number of rows to the DIALOG instruction: It is defined by the number of elements in the array. However, when using the paged mode in a DISPLAY ARRAY, the total number of rows does not correspond to the elements in the program array, because the program array holds only a page of the whole list. In any other cases, a call to this method is just ignored.

A call to setArrayLength() will not trigger the execution of the ON FILL BUFFER clause immediately. The trigger to fill a page of rows will be executed when all the user code has been execute and the control goes back to the dialog instruction.

The setArrayLength() method is also be used to fix the final number of rows when using COUNT=-1 attribute, to implement a paged list without knowing the total number of rows when the dialog starts.