Function DbContinue() Foundation

Continues a sequential search defined by DbLocate().

Syntax
DbContinue() --> lFound
Return

The function DbContinue() returns the value .T. (true) when another data record was found matching the search condition defined by DbLocate(). .F. (false) is returned if no additional matching records are found.

Description

The function DbLocate() defines a search condition for each work area that is the subject of a sequential search for matching records in that work area. The search is also initiated by DbLocate() and continued using DbContinue(). In this way all records in a work area matching a search condition can be found.

The function DbContinue() moves the record pointer in the work area until a matching record is found. The matching record becomes the current record and DbContinue() returns the value .T. (true). The function Found() can also be used to test the result of a DbContinue(). If no matching record is found, the return value is .F. (false) and the record pointer is positioned after the last record. In this case, the function Eof() returns the value .T. (true).

If DbContinue() is called without the alias operator, the search occurs in the current work area. This is identical to executing the command CONTINUE.

Examples
DbContinue()
// Using DbLocate() and DbContinue(), the example lists 
// all employees from a personnel database belonging to a 
// specific department. 

PROCEDURE MAIN 
   LOCAL cDepartment := "S-DEV" 
   FIELD EmployeeNo, LastName, FirstName 

   DbUseArea( .T.,, "Employee" ) 

   DbLocate( {|| FIELD->DeptNo = cDepartment } ) 

   IF Found() 
      ? "Employees in department:", cDepartment 
      ? EmployeeNo, LastName, FirstName 

      DO WHILE DbContinue() 
         ? EmployeeNo, LastName, FirstName 
      ENDDO 
   ENDIF 

   DbCloseArea() 
RETURN 
Feedback

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.