i = noccurs(group);
The noccurs function returns the number of occurrences of a roster, form, or record. It is equivalent to the count function without the where phrase.
During data entry, you may determine the current occurrence of a roster or form. The occurrence value is updated after the first entry into the first field. If the noccurs function is executed prior to the roster or form it specifies then it returns 0. If it is executed from a field within the roster or form, it returns the current occurrence number after the first field is on the path. For example, its value in the PREPROC of the first occurrence of the first item entered in a form or roster is zero (0), i.e., before entry. After entry its value will always be one (1). This is true for each occurrence keyed, the noccurs function is not incremented until the cursor is in or has passed through the first field on the roster or form. If it is executed after the form or roster, it returns the total number of occurrences in the form or roster. If the form does not repeat, noccurs will return 1 (a roster must always repeat). When used in Data entry noccurs and soccurs functions are the same.
During batch editing, noccurs always returns the total number of occurrences in the group.
The function returns the number of occurrences as an integer value.
TOTAL_PERSONS = noccurs(PERSON);