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:
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.
- Switches between project scope and folder scope.
- Displays the Look Up Reference dialog box for you to perform a new code reference search.
- Updates previous search results with current results.
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.
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.
- Replace withВ В В Specifies the replacement expression for the selected code reference or references.
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.
TypeВ В В Specify Report.
DataВ В В Specify description of the report.
FilenameВ В В Specify the name of the report, such as "report1.frx".
- Search setВ В В Specifies all code reference search results or a set of results that you want to print.
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.
- 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.
- Opens the Options dialog box to set additional options for your search. For more information, see Look Up Reference Dialog Box, Options Dialog Box.
- Opens the Visual FoxPro Help file.
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:
- 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.
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:
- 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.
- File NameВ В В Organizes items based on file name.
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.
In the Code References window, right-click in the area to the right of the toolbar.
From the shortcut menu, select Display Descriptions.