arr_count()

arr_count() returns a positive whole number, typically representing the number of records entered in a program array during or after execution of the INPUT ARRAY statement.

You can use arr_count() to determine the number of program records that are currently stored in a program array. In typical 4GL applications, these records correspond to values from the active set of retrieved database rows from the most recent query. By first calling set_count(), you can set an upper limit on the value that arr_count() returns.

arr_count() returns a positive integer, corresponding to the index of the furthest record within the program array that the screen cursor accessed. Not all the rows counted by arr_count() necessarily contain data (for example, if the user presses the DOWN ARROW key more times than there are rows of data). If set_count() was explicitly called, arr_count() returns the greater of these two values: the argument of set_count() or the highest value attained by the array index.

This example uses the value returned by arr_count() to count the size of the screen record:

 

This example makes use of ARR_COUNT( ) and the related built-in functions ARR_ CURR( ) and SCR_LINE( ) to assign values to variables within the BEFORE ROW clause of a DISPLAY ARRAY statement.

By calling these functions in BEFORE ROW, the respective variables are evaluated each time the cursor moves to a new line and are available within other clauses of the DISPLAY ARRAY statement.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.