Viewing Code Definitions

You can locate the definition of a code element found in a code reference search in the current program file, if the definition exists, using the View Definition command that appears on the shortcut menu in the Editing window.

To view the definition of a code element

  1. Open the program file to the location of the code element.
  2. Double-click the text of the code element to select it.
  3. Right-click to display the shortcut menu, and select View Definition.

You can also call View Definition using the DO (_FOXREF) WITH... command. For more information, see _FOXREF System Variable.

If the code element is user-defined, and the definition is found, Visual FoxPro opens the Editing window to the location of the definition. If the item you select is a native Visual FoxPro command or function, the Visual FoxPro Help opens the Help topic for that item. If the item you select is a file name, such as for a #INCLUDE statement or SET PROCEDURE command, Visual FoxPro opens the file.

If multiple definitions exist, Visual FoxPro opens the Go To Definition window for you to select the correct definition. View Definition first searches for other external file references that are in the source file, followed by files in the active project.

If the definition cannot be found in a file for the active project, View Definition searches other open projects or folders. If the definition is found in one of these locations, the Go To Definition window opens for you to select the correct location.

See Also

Creating Programs | Look Up Reference Dialog Box | Code References Window | Go To Definition Window