6. Functions : Stat Library Functions : AVERAGE Function : Example—AVERAGE function:
 
Share this page                  
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