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

Access Tips

FoxPro Tips

General Tips

 

Related Items

Visual FoxPro Tutorial - Program control

Program control structures in Visual FOxPro

Read More

Visual FoxPro Tutorial - Do Case

Visual FoxPro Tutorial - Using the Do Case structure to control program execution

Read More

Visual FoxPro Tutorial - Program Code

Visual FoxPro Tutorial - Writing program code

Read More

Visual FoxPro Tutorial - Development Environment

The Integrated Development Environment (IDE) for Visual FoxPro

Read More

Visual FoxPro Tutorial - Build an executable

Visual FoxPro Tutorial - Build a Windows executable from a Foxpro project

Read More