Continues the previous LOCATE.
CONTINUE |
Remarks
CONTINUE is used after LOCATE succeeds in finding a record, to continue the LOCATE operation. CONTINUE moves the record pointer to the next record for which the logical expression specified in the previous LOCATE evaluates to True (.T.).
CONTINUE can be repeated until the end of the file is encountered, or until the end of the scope you specified with LOCATE is reached.
If CONTINUE succeeds in finding a record, RECNO(В ) returns the record number of the record, FOUND(В ) returns a value of True (.T.), and EOF(В ) returns a value of False (.F.).
If CONTINUE doesn't succeed in finding a record, RECNO(В ) returns the number of records in the table plus one, FOUND(В ) returns False (.F.), and EOF(В ) returns True (.T.).
Example
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.
В | Copy Code |
---|---|
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)) |