This utility allows you to search script source for a specified text string and, if you wish, replace the text string with another. You can select to search all forms’ scripts, a selected form’s scripts, any global procedures, any global functions or a combination of these. This utility is useful if you’ve changed the name of a resource, such as a field or window, and need to update the references to the resource in your application’s scripts.
To begin a search, select an editable dictionary, then choose Search and Replace from the Scripts menu to display the Search and Replace window.
In the Search For field, enter the text that you want to find. The entry can be up to 255 characters. Note that the search is case-sensitive.
Enter a replacement string, if desired. The entry can be up to 255 characters. If this field is left blank, the occurrences of the string you’re searching for will be listed on the status report, but no text will be replaced.
Use caution when replacing strings using this utility. Any occurrences of the specified string will be replaced, including partial strings. For instance, if you replaced “Customer” with “Client”, the field name Customer_Number would become Client_Number. You may want to search for the specified string and view the status report first. This will allow you to see which items will be replaced before you perform the replace operation.
Select the series containing the script to be searched, then select the appropriate resource type. Select Forms to display a list of all forms in the selected series. Select Global Procedures to display a list of the global procedures in the selected series. Select Global Functions to display a list of the global functions in the selected series.
You can set a default series prior to beginning the search and replace process. Select a series from the Series list located on the toolbar. Once specified, the selected series will appear as the default whenever a series can be selected in a window.
From the Resources list, select the global procedures, global functions or the forms containing the scripts you want to search and click Insert to add items to the Selected Scripts list. Double-clicking your selection will perform the same function. If you want to search all global procedures, global functions or form scripts in a series, simply click the Insert All button. You can use the Remove and Remove All buttons to remove scripts from the Selected Scripts list.
Click the Search button to search for the specified string. The Report File Name dialog box will appear, allowing you to enter the name and location for the Search and Replace Report file. Click OK to continue the search and replace process, or click Cancel to return to the Search and Replace window. If you continue the search and replace process and you specified replacement text, any occurrences of the text being searched for will be replaced.
The status report lists all occurrences of the text you searched for. If you only searched for a string, the report will list what type of script the string was found in, the script name, the line number and actual line where the string was found. If you replaced the string, the report will list the type of script the string was found in, the script name, and the number of occurrences of the string that were replaced.