Format:
i = curocc([group]);
Description:
The curocc function returns the current occurrence number for a roster, form, or record.
During data entry, you may determine the current occurrence of a roster or form. If the form does not repeat, curocc will return 1 (a roster must always repeat). The current occurrence can be determined by calling the curocc function from any field contained within the roster or form. If it is executed prior to the roster or repeating form it names, it returns 0. If it is invoked after entry of the roster or form has completed, it returns the total number of occurrences keyed.
During batch editing, you may determine the current occurrence of a record or repeating item. If the curocc function is used in a procedure not associated with an item on a record then curocc will return the total number of occurrences found. If the curocc function is used in a procedure associated with an item on the record, it will return the sequence number of the record in the case. The curocc of a repeating item will be its sequence number within the group.
Return value:
The function returns the occurrence number as an integer.
Examples 1:
PROC RELATION
if curocc(PERSON_REC) = 1 then
if (RELATION <> 1) then
errmsg("First person must be head of household.");
endif;
endif;
See also: Maxocc Function, Totocc Function, Noccurs Function, Soccurs Function, Count Function , If Statement, Errmsg Function