In the following example, all customers from France are counted and the total is displayed. All records are found using one LOCATE command followed by a CONTINUE command within a loop.
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer && Opens Customer table
SET TALK OFF
STORE 0 TO gnCount
LOCATE FOR ALLTRIM(UPPER(country)) = 'FRANCE'
DO WHILE FOUND( )
gnCount = gnCount + 1
CONTINUE
ENDDO
? 'Total customers from France: '+ LTRIM(STR(gnCount))