The FoxPro GOTO statement


FoxPro does in fact have a GoTo statement but it's not a program control command. Instead it moves the record pointer to the record number specified:

Goto 12

will move the record pointer to record number 12. This command is useful in small record sets but can be slow in a large table and it goes against the spirit of a relational database. When you use it you assume that you can rely on the absolute position of a record in a data set and you restrict yourself to using native FoxPro data sources.

This command should be considered as being included for backwards compatibilty only.

The word "Goto" is actually optional. The command:

12

on its own will move the record pointer to record 12. An idiosyncracy of the language which should not be used in production code.


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