DISPLAY ARRAY

 

DISPLAY ARRAY statement is a special case of the DISPLAY statement which includes most of the additional clauses common for INPUT and INPUT ARRAY statement as well as its own additional clauses.

 

 

Element

Description

Binding Clause

This is an obligatory clause which specifies the program array and the record array to which it must be displayed

ATTRIBUTE Clause

An optional ATTRIBUTE clause where the attributes for the fields used in the DISPLAY ARRAY statement can be specified

HELP Clause

An optional HELP clause where the help number for the DISPLAY ARRAY statement can be specified

WITHOUT SCROLL clause

This optional clause consists of the WITHOUT SCROLL keywords.

INPUT Control Block

An optional DISPLAY control block which controls the display of the data

 

DISPLAY ARRAY statement is used to display program arrays to screen arrays; it may include optional clauses.

To use the DISPLAY ARRAY statement, follow these steps:

  1. Specify a screen array in a form specification file

  2. DEFINE an ARRAY of program records. The members of the records must match the fields of the previously specified screen array in order, number and data types

  3. Open and display the form that contains the specified screen array (you may use the OPEN FORM and then the DISPLAY FORM statements or the OPEN WINDOW ... WITH FORM statement)

  4. Populate the program array with the data to be displayed

  5. Call the set_count(i) built-in function. Here, "i" is the number of the records filled with data

  6. Use the DISPLAY ARRAY statement to display these data to a screen array

 

The set_count() function specifies the initial value for arr_count() function. If it is not set, no data will be displayed. For detailed information, see the Querix reference on built-in functions.

 

The data types of the values in each record should correspond to the data types of the fields of the screen array. The size of screen array determines the number of program records 4GL can display at a time. The size of a program array determines the number of data it can store. If the size of a program array is larger than the size of a screen array, the user can scroll through the rows in the form.

 

DISPLAY ARRAY statement has the following effect:

  1. The values of the program array are displayed to the fields of the screen array

  2. The cursor is moved to the first field of the first screen record

  3. The user is expected to press either scroll key or accept key.

 

DISPLAY ARRAY statement is not terminated until the Accept or Interrupt key is pressed, unless it includes the WITHOUT SCROLL keywords.

 

The values are displayed by means of the DISPLAY ARRAY statement in the same way as by the DISPLAY statement: