Command COUNT Foundation
Determines the number of records matching a condition.
COUNT TO <VarName> ;
[FOR <lForCondition>] ;
[WHILE <lWhileCondition>] ;
[NEXT <nCount>] ;
[REST] ;
[ALL]
The command COUNT counts the number of records in the current work area matching the specified condition. The count range can be limited by options such as NEXT or REST. The count result is assigned to the variable <VarName>.
// In the example, the unpaid invoices in an
// invoice file are counted.
PROCEDURE Main
LOCAL nUnPaid := 0
USE Invoice NEW
COUNT TO nUnPaid FOR Payment == 0
? "Unpaid invoices:", nUnPaid
USE
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.