Freigeben über


Scope Clauses

If a Visual FoxPro command has a Scope clause, you can specify a record range for the command to act on by replacing Scope with one of the clauses in the following table.

Scope clause Effect
ALL Command affects all records in the table.
NEXT nExpr Command affects a range of records beginning at the current record and continuing for the specified number of records.
For instance, the following example acts on the current record and the two following records:
 
REPLACE status WITH "open" NEXT 3
RECORD nNumber Command affects only the specified record number.
The following example acts on record five.
 
REPLACE status WITH "open" RECORD 5
REST Command affects a range of records beginning with the current record and ending with the last record in the table.
The following example stores a null value in the remaining records.
 
REPLACE status WITH .NULL. REST

You can also specify record ranges with FOR and WHILE clauses.

See Also

FOR Clauses | REPLACE Command | WHILE Clauses | Field and Record Manipulation | Data Manipulation