Compartir a través de


Code References Window

Displays the results from a code reference search that meet the project/folder scope and file types specified in the Look Up Reference dialog box. For more information, see Look Up Reference Dialog Box.

The Code References window appears after you perform a search in the Look Up Reference dialog box or when you select Code References from the Tools menu when searching for a previously searched code reference in the same project or folder. The currently active project always takes precedence over Folder scope. If the Look Up Reference dialog box has been previously opened, you can also call the Code References window using the following code:

DO(_FOXREF)

You can set the Code References window to always appear in the foreground when other windows are active. In the Code References window, right-click in the area to the right of the toolbar and select Always On Top.

However, if you selected Always on Top for other Visual FoxPro windows, you will see no difference in behavior.

The following buttons are available in the Code References window. You can find some of these commands on shortcut menus available from different panes in the Code Reference window.

  • Open (folder icon)
    Opens or brings forward the designer for the selected file. The Open command is available only when a file node is selected.

  • Arrow
    Switches between project scope and folder scope.

  • Search
    Displays the Look Up Reference dialog box for you to perform a new code reference search.

  • Refresh
    Updates previous search results with current results.

  • Replace
    Displays a Replace dialog box for you to specify a replacement expression for selected code references in the results pane. The following options are available in the Replace dialog box:

    • Replace with   Specifies the replacement expression for the selected code reference or references.

    • Confirm replacements   Opens a dialog box for you to confirm, decline, or cancel the replacement operation for each code reference.

    • Preserve case   Performs replacement operations using the original casing of the code reference or text being replaced. Case preservation of text includes only uppercase, lowercase, and title (proper) case, in which the first letter of each word is capitalized. This option does not support mixed case such as in "FoxPro" because the lengths of the original and replacement values can differ.

    • Create backup of modified files   Makes a backup copy of the selected files before performing a replacement operation. Backup copies are stored in the same locations as the original files. You can open the Options dialog box from the Code References window or Look Up Reference dialog box to control the naming of backup files.

    Visual FoxPro creates an activity log containing the most recent results of individual code reference replacements. These activity logs are shown below the Replacement Logs node in the search pane. Each log contains the following items:

    • A line that shows the original and replacement value

    • Whether the replacement operation succeeded and whether a reference was skipped using the Confirm Replacements option

    • Details and code for you to make data structure changes if data files might be affected

      Note

      Search and replace operations can include all Visual FoxPro files, including data files. As a result, performing replacement operations can change data structures.

      Note

      When this possibility occurs, Visual FoxPro shows a dialog box prompting you to confirm or decline the replacement operation. If you confirm the replacement operation, Visual FoxPro performs only those replacements that do not affect data files and provides code in the search string node under the Replacement Logs node for you to manually perform the desired changes. If you decline replacement, no changes are made.

      Note

      Additionally, the Code Reference tool does not support replacement of property or method names in a form (.scx) or visual class library (.vcx) because of possible changes to subclasses and outstanding references.

  • Print
    Displays a Print dialog box for you to select a set of code reference search results for printing. The following options are available in the Print dialog box:

    • Search set   Specifies all code reference search results or a set of results that you want to print.

    • All   Specifies that all references in the selected set of code references should be printed.

    • Selected items only   Specifies that only the selected items for a set of code references are printed.

    • Print   Prints the specified set of code references.

    • Preview   Opens a Print Preview dialog box and the Report Designer for you to preview the set of code references to be printed.

    You can specify a different report if desired by modifying the following fields in the RefAddin.dbf file:

    • Type   Specify Report.

    • Data   Specify description of the report.

    • Filename   Specify the name of the report, such as "report1.frx".

  • Export
    Displays an Export dialog box for you to export all or a set of code reference search results to a variety of formats. The following options are available in the Export dialog box:

    • Type   Specifies the target file type for your search results. To make XML Output Options available, select Extensible Markup Language (XML) in the Type drop-down list.

      When exporting your search results to HTML, Visual FoxPro generates the file using XML and XSLT. By default, Visual FoxPro searches for a FoxRef.xsl file in the Visual FoxPro home directory or HOME(0). If the file is not found, Visual FoxPro copies an internal .xsl file and places it in the Visual FoxPro User Application Data directory or HOME(7) unless you specify a different directory. You can supply an XSLT file for formatting the HTML file by renaming your XSLT file to FoxRef.xsl and replacing the original .xsl file with the new file.

    • To   Specifies a file name for the exported file. To choose a location other than the current folder for the exported file, click the ellipsis (...) button.

    • Search set   Specifies all code reference search results or a set of results that you want to export.

    • View after export   Specifies that you view the generated results after the export operation finishes. This option becomes unavailable if you select Clipboard as the target file type.

    • XML Output Options   Specifies the following additional options for exporting search results to XML output:

      Generate element-based XML   Generates an XML file in which fields are stored as elements.

      Generate attribute-based XML   Generates an XML file in which fields are stored as attributes.

      Include schema   Adds XML Schema Definition (XSD) schema to XML output.

    • All   Specifies that all references in the selected set of code references should be exported.

    • Selected items only   Specifies that only the selected items for a set of code references are exported.

  • Options
    Opens the Options dialog box to set additional options for your search. For more information, see Look Up Reference Dialog Box, Options Dialog Box.

  • Help
    Opens the Visual FoxPro Help file.

Search Pane

The search pane, or upper-left window, contains a collapsible tree view of the results from a code reference search. The tree view displays an All Results node, each code reference, and the files that contain the reference. When you click a file name, the view in the results pane, or upper right window, is filtered to represent only the results from that particular file.

A Replacement Logs node appears in the search pane when logs containing the most recent results of individual code reference replacement operations are created.

The following commands are additionally available from a shortcut menu that appears when you right-click a navigation, code reference, or file node inside the search pane:

  • Copy
    Copies all information in the results pane, including the file name, class, method or procedure, and line information, for the item selected to the clipboard so that you can paste the information elsewhere.

  • Expand All
    Fully expands the search results tree.

  • Collapse All
    Collapses the search results tree.

  • Sort by Most Recent First
    Sorts the search results in the tree, placing the most recent results at the top of the tree.

  • Clear Result
    Removes the selected result from the search pane. The Clear Result command is not available if the All Results node is selected. If a file is selected, only that file is removed from the search pane.

  • Clear All Results
    Removes all search results from the search pane.

  • Refresh

Results Pane

The results pane, or upper-right window, displays results from a code reference search, including potential definitions, if they exist, which you can quickly jump to, and multiple references that might exist in a single line of code. If multiple references per line exist, the results pane displays an indicator (the number of references enclosed by a circle) on that line.

The results pane shows the following items:

  • Check boxes for you to select individual lines of code

  • #   Number of code reference instances that occur in the result, if more than one

  • File Name   File name and location of the code reference

  • Class.Method, Line   Class, method, and line number

  • Code   Line of code that contains the code reference

You can sort items in each column by clicking each of the column headers.

The following commands are additionally available from a shortcut menu that appears when you right-click a selected reference inside the results pane:

  • Copy
    Copies all information for the selected line, including the file name, class, method or procedure, and line information, to the clipboard so that you can paste the information elsewhere.

  • Select All
    Selects all the items in the results pane.

  • Clear Selections
    Clears the check boxes in the results pane.

  • Sort by
    Organizes the items in the following manner:

    • File Name   Organizes items based on file name.

    • Class.Method   Organizes items based on class name followed by method name.

    • Selected   Groups items by whether they are selected.

    • File Type   Organizes items based on file type (extension).

    • Location   Organizes items by folder location.

Description Pane

The description pane, or bottom window, displays information about a code reference search such as the project or folder searched and the matches found. When a reference is selected, the description pane shows the location of the reference and the line of code in which the expression appears.

To hide or display the description pane

  1. In the Code References window, right-click in the area to the right of the toolbar.

  2. From the shortcut menu, select Display Descriptions.

See Also

Tasks

How to: View Code Definitions

Reference

Look Up Reference Dialog Box

Look Up Reference Dialog Box, Options Dialog Box

HOME( ) Function

Other Resources

Windows (Visual FoxPro)