4D v13.4Sum |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
Sum
Sum
The Sum command returns the sum (total of all values) for series. If series is an indexed field, the index is used to total the values. You can pass an array (one or two dimensions) in series. In this case, the array must be of the Integer, Longint or Real type. If the command is correctly executed, the OK system variable is set to 1. If it is interrupted (for example if the user clicks on the Stop button of the progress thermometer), the OK variable is set to 0. The following example is an object method for a vTotal variable placed in a form. The object method assigns the sum of all salaries to vTotal: vTotal:=Sum([Employees]Salary) The following method is called to print the records in the selection and to activate break processing: ALL RECORDS([Employees]) Note: The parameter to the BREAK LEVEL command should be equal to the number of breaks in your report. For more information about break processing, refer to the printing commands. This example gets the sum of all the values placed in an array: ARRAY REAL($ArrGrades;0) |
PROPERTIES
Product: 4D
INDEX HISTORY
SEE ALSO
ACCUMULATE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||