Note | This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available |
Resume a pending locate.
CONTINUE
CONTINUE searches from the current record position for the next record meeting the most recent locate condition executed in the current work area. (You can set the locate condition with the LOCATE command or with the VODBLocate() or VODBSetLocate() functions.)
The search terminates when a match is found or end of file is encountered. If CONTINUE is successful, the matching record becomes the current record and Found() returns TRUE; if unsuccessful, Found() returns FALSE.
Each work area can have an active locate condition. A locate condition remains pending until a new one is specified.
Scope and WHILE condition: The scope and WHILE condition of the locate condition are ignored; only the for condition is used with CONTINUE. If you are using a LOCATE command with a while condition and want to continue the search for a matching record, use SKIP and then repeat the original LOCATE command, adding REST as the scope.
This example scans records in SALES.DBF for a particular salesman and displays a running total sales amount:
LOCAL nRunTotal := 0
USE sales NEW
LOCATE FOR Sales->Salesman = "1002"
DO WHILE Found()
? Sales->SalesName, nRunTotal += Sales->Amount
CONTINUE
ENDDO
This example demonstrates how to continue if the pending LOCATE scope contains a WHILE condition:
LOCAL nRunTotal := 0
USE sales INDEX salesman NEW
SEEK "1002"
LOCATE REST WHILE Sales->Salesman = "1002";
FOR Sales->Amount > 5000
DO WHILE Found()
? Sales->Salesname, nRunTotal += Sales->Amount
SKIP
LOCATE REST WHILE Sales->Salesman = "1002";
FOR Sales->Amount > 5000
ENDDO
XSharp.RT.DLL
DbContinue(), DbLocate(), EoF(), Found(), LOCATE, SEEK