FORMULA LANGUAGE
Examples: @Sum
1. This example returns 3.
@Sum( 1 : 2 )
2. This example returns 11.
@Sum( (-1) : 2 ; (-10) : 20 )
3. This example sets the Total field to 50 if numPersons is a number field containing 5; 10; 15; 20.
@SetField("Total";@Sum(numPersons))
4. This example looks at the Transactions view in the current database, whose first column contains number values indicating the amount of a transaction. The formula sums the transactions and places the total in the result field on the current document.
FIELD result:=result;
r:=@DbColumn("":""; ""; "Transactions"; 1 );
@SetField( "result"; @Sum( r ) )
5. This example displays a view in a dialog box. The first column in the view contains a product name, the second contains its price. After the user selects one or more products in the dialog box, the formula displays the total cost of the selected items.
amounts:=@PickList( [Custom]; @DbName ; "Products"; "Choose products"; "Please select the products you want to order"; 2 );
total:=@Sum( @TextToNumber( amounts ) );
@Prompt([Ok]; "Total"; "The total cost of these products is " + @Text(total))
See Also
@Sum
Glossary
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Glossary