4D v14.3Find and replace in methods |
||
|
4D v14.3
Find and replace in methods
Find and replace in methods
The Method editor has specific find and replace functions that apply to the current window. The find area located in the toolbar of each method window can be used to carry out simple searches or to call the Find dialog box (see Method editor). The Find/Replace commands for methods are located in the Find submenu of the Edit menu of 4D: Note: The find commands located above the Find submenu are not specific to the Method editor but may be used to search for a value among all the methods. For more information, refer to Searching and replacing in the Design. Selecting the Find... command displays the following dialog box: The search defined in this dialog box will be performed in the method located in the foreground.
When you click on OK, 4D begins searching from the current text insertion point and continues to the end of the method. The first item corresponding to the set criteria is thus selected in the Method editor window. It is then possible to continue the search using the Find Next and Find Previous commands of the Edit menu. The Find Same command is used to find character strings identical to the one selected. This command is only active if you have selected at least one character in the Method editor. The search carried out is of the “Find Next” type in the current method. The Bookmark All command is enabled when a search has already been specified in the find or replace dialog box. When you select this command, 4D puts a bookmark at each line that contains an item corresponding to the "current" search criteria. This makes it easy to spot all the search results. For more information about bookmarks, refer to the "Using bookmarks" section in Writing a method. The Replace command displays the following dialog box:
The Replace button is used to launch the search and replace the first occurrence found. 4D begins searching from the current text insertion point and continues to the end of the method. It is then possible to continue finding/replacing using the Replace Next and Replace Previous commands of the Edit menu. The Everywhere button is used to replace all the occurrences corresponding to the search criteria directly in the open method. The Goto Definition command opens the definition of an object referenced in the Method editor (method, field, table or form) directly in a new window. To do this, place the cursor inside the object name (or select it) and choose Goto Definition... from the Method menu or from the context menu of the editor. This command functions with the following objects:
The Search references... command found in the Method menu or the context menu of the Method editor finds all the objects (methods and forms) in the database where the current item of the method is referenced (used). The current item is either the one selected or the one where the cursor is located. It can be a field name, variable name, command, string, and so on. For example, the following action looks for all the occurrences of the vlNbCmd variable in the database: This command displays its results in a new window. For more information about the results window, refer to Results window. The Search Callers command in the Method menu is only enabled for project methods. It searches for all the objects (other methods or menus) that reference the project method. Note: The Search Callers... command is also available on the Methods Page of the Explorer. This command displays its results in a new window. For more information about the results window, refer to Results window. This specific search command is located in the Method menu. It opens a dialog box where you can indicate the line number you want to find. When you click OK, the editor finds and highlights that line in the method. This type of search is useful when used in conjunction with the compiler, which flags runtime errors by the line number in which they occur. You can choose whether or not to display lines numbers in the Method editor window. This option is described in the Method editor. |
PROPERTIES
Product: 4D ARTICLE USAGE
4D Design Reference ( 4D v14 R2) Inherited from : Find and replace in methods ( 4D v12.4) |