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

MS Access technical tips

Visual FoxPro technical tips

General Tips

 

More tips from Alvechurch Data

Visual FoxPro Tutorial - If ... Else ... EndIf

Using If EndIf to control program flow in Visual FoxPro

Read More

Visual FoxPro Tutorial - Navigation

Navigating between records in Visual FoxPro

Read More

Visual FoxPro Tutorial - Scan ... EndScan loop

Using a scan loop to control program flow in Visual FoxPro

Read More

Visual FoxPro Tutorial - Variables

Using variables in Visual FoxPro

Read More

Visual FoxPro Tutorial - Program control

Syntax for program control structures in Visual FOxPro

Read More