Find and Replace in Files
Use the Find and Replace In Files dialog to search for text in multiple files and optionally replace the text.
Search options for each workspace are saved when you leave the workspace and restored when you return. Additionally, the search options in this dialog are automatically applied to the Find All Occurrences editor operation.
The Find and Replace In Files dialog operates in two different modes: Find In Files mode and Replace In Files mode.
Find In Files
When the Find In Files button is selected, the dialog operates in Find In Files mode. This mode allows the Studio to search for a text string in multiple files.
Replace In Files
When the Replace In Files button is selected, the dialog operates in Replace In Files mode. This mode allows the Studio to search for a text string in multiple files and replace occurrences of that text with a replacement string.
Text to Find
Enter the text that you wish to locate. The multiple files search feature does not support regular expressions in the search string (as the Find text feature does).
The combo list allows you to select from a list of recently searched text strings. This list is saved and restored the next time that you open the Studio.
Text to Replace
When the dialog is in Replace In Files mode, enter the text that will replace the Text to Find text.
The combo list allows you to select from a list of recently used replacement strings. This list is saved and restored the next time that you start the Studio.
Keep Modified Files Open After Replace All (Allows Undo)
When the dialog is in Replace In Files mode, check this option to ensure the Studio keeps all files open where it performs replacements via the Replace All button.
Keeping the files open after a Replace All is useful, as it allows you to use the Studio's Undo feature to undo unwanted replacements in each file.
If you uncheck this option, then the Studio will perform replacements without fully opening the files. This is faster but does not allow undo operations.
Search Where
To search every source file in the make path that is used in the current project, select the Current Project Files Only radio button. This option will ignore source files in the project make path that are not used by the current project.
- To search in just those files that you currently have open in the Studio, select the Open Files Only radio button.
- To search in specific directories, select the Directories Listed Below radio button. To extend the search to all subdirectories of the directories that you specified, also check the Search subdirectories checkbox.
- Click the All Source Paths button to populate the Directories to Search list with the entire set of source folders available to this workspace.
Directories to Search
This is a list of directories containing the files to be searched. You may add, edit, or remove directories from this list.
This list is saved and restored for each workspace. This means that when you change workspaces, the Studio will load the last saved directories to search for that workspace.
Use the checkbox column to enable or disable a directory in the list. This allows you to retain a list of common directories to be searched and turn on or off searching in those directories without having to edit the list.
When you select or click on a directory in the list, you will see a combo list available. This is a list of commonly searched directories for the current workspace. Use this list to add one of these directories to your search path.
Match Case
Check Match Case if the case of the Find text is significant in the search. For example, if you are searching for "BEGIN," then the string "Begin" would not produce a match.
Match Whole Word Only
Check Match whole word only if the Find text must match an entire word rather than a portion of some word. For example, if you are searching for "one," then the string "tone" would not produce a match.
Browse
Click the Browse button to activate the folder browser dialog. This allows you to browse the directories on your system. The directory that you select in this dialog will replace the selected row in the Directories to Search list.
If you type a partial directory path in the list before activating the browser, then the browser will use this partial path as a starting point.
Remove
Click the Remove button to remove the currently selected row from the Directories to Search list.
Search Subdirectories
Check Search Subdirectories if you want the listed directories and their subdirectories to be searched.
File Mask
The File Mask text box allows you to filter the files that will be searched by filename. Wildcards * and ? are supported. You can enter multiple masks by separating them with semicolons.
The combo displays a list of common file masks for DataFlex source files.
Find All
Click the Find All button to perform the search. While the search is being performed, a progress message will display, and you can click its Cancel button to stop the search.
When files are found that contain the search text, the Find Results panel will appear listing each file where the text was found. You can use this panel to browse the results and open one or more of the listed files.
Find First
Click the Find First button to start a Replace In Files operation. This performs a semi-automatic replacement where you have the opportunity to confirm each replacement.
When files are found that contain the search text, the Find Results panel will appear listing each file where the text was found. The first file where the text occurs is opened, and the first occurrence of that text in the file is selected.
The Studio also activates the Replace In Files panel. This panel provides buttons to control each replacement during the Replace In Files operation.
Replace All
Click the Replace All button to perform a fully automatic Replace In Files operation. A progress message will display, and you can click its Cancel button to stop the replacement operation.
If you have checked the Keep modified files open after Replace All box, then each file where the replacement occurs will be opened in the Studio, allowing you to undo the replacements. If the box is unchecked, then the replacement is performed without fully opening the files. This is faster, but you will not be able to undo.
The Find Results panel will appear listing each file where the text was found. You can use this panel to open files and review each replacement.
Cancel
Click Cancel to close the panel without performing any further action.