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.

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

 

set_count() specifies the initial value for arr_count(). If it is not set, no data will be displayed.

 

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 this 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:

If you use the DISPLAY ARRAY statement independently, you can omit END DISPLAY keywords.

If you use DISPLAY ARRAY within any dialog block, END DISPLAY keywords are required.

 

When you call INPUT, INPUT ARRAY, or DISPLAY ARRAY statements from another DISPLAY ARRAy, you must explicitly specify the end of the embedded statement (by END INPUT or END DISPLAY). Otherwise, you will get the compilation error because the compiler will not understand the order of statements and their clauses.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.