Database development and training for Birmingham and the midlands
Specialists in Microsoft Access and Visual Foxpro database training and development
I am happy to hear from existing clients but I am taking no new calls.
VFP Tutorial - Scan ... EndScan loop
The scan loop is unique to FoxPro. It processes records in a table and executes the commands within the loop once for every record in the current work area:
Use Staff In 0
* Modify salaries and bonuses
If Title = 'manager'
* More money for managers
Replace Salary With Salary * 1.10
Replace Bonus With 10000
* No rise or bonus for the other employees
Replace Bonus With 0
The code in this example will modify every record in the Staff table and reward the managers.
This example shows how one control structure can be embedded within another. The If structure is executed once for every record in the table.
Back to FoxPro program control.