Was this helpful?
AVERAGE Function
The AVERAGE function calculates the sum of the values in a list divided by the total number of items in the list. It returns the arithmetic mean.
This function has the following syntax:
AVERAGE(list = list)
Arguments
Data Type
Description
list
Array of Object, which can be an Array of FloatObject, IntegerObject, or MoneyObject
List of items to average
This function returns:
Float—Average value of items in list
Null—On error
Example—AVERAGE function:
/*  Calculate the average value of digits 1 through 9
**  In the following example there is a button in the
**  frame named 'btn_calc'.
*/
intialize =
declare
    digits1_9 = array of FloatObject;
    j = integer not null;
enddeclare
begin
    for j = 1 to 9 do
        digits1_9[j].value = j;
    endfor;
end
on click btn_ok =
begin
    average_result = average(list = digits1_9);
end
Last modified date: 06/25/2024