VFP Tutorial - For ... Next loop


Executes a section of code several times. The number of repetitions is controlled by a counter which increases by one each time that the loop executes:

lnLimit = 10
For lnCount = 1 To lnLimit
   *-- Print the numbers from 1 to lnLimit inclusive
   Print lnCount
Next lnCount

The code in this example will execute ten times and will print the numbers from one to ten.

Notes

The Next lnCount marking the end of the structure can be replaced by EndFor but you may find it easier to use the Next option because it is the same form as in Visual Basic and Access.

Back to FoxPro program control .


Introduction | Environment | Project | Tables | Forms | Navigation | Executable


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map