You specify your search criteria in the "Find in design" window. To do so:
Click on the magnifying glass button in the toolbar of 4D. OR Choose the Find in Design... command from the Edit menu. The Find in design window appears:
The areas of this window vary dynamically depending on the selections made in the menus.
Build your search using the different menus and entry areas of the "Definition" area and if necessary enter the character string to be searched for. These items are described in the following sections.
Set the search options (if necessary). These options are described in the “Searching options” section
below.
Click OK or press the Enter key. The search begins. When it is finished, the result window appears, listing the objects containing the string entered (see Results window). Note: You can interrupt a search that is underway at any time by hitting the Esc key.
Once you have executed a search, the value entered in the search area is saved in memory. This value, as well as all the other values entered during the same session, can be selected from the combo box:
You can perform searches using the toolbar of the 4D Design environment.
If no search was carried out yet during the session, you can enter the character string you want to search for then hit the Carriage return or Enter key. A search of the "text which contains" type with the default options is carried out automatically.
If you want to repeat a search that was already done during the session, you can select it in the scroll-down list.
If the search was performed using the Find window, it is carried out using any options set in this window.
The search begins immediately. When it is done, a result window appears, listing all the objects containing the string entered.
You can specify the type of element to look for using the Find menu. The following choices are available:
Text: In this case, 4D looks for a character string throughout the Design environment. The search is done in plain text mode, without taking the context into account. For example, you can look for the text "ALERT("Error number:"+" or "button27". In this mode, you cannot use the wildcard character because "@" is considered to be a standard character.
Comment: This search is basically the same as the previous one but it is restricted to the contents of comments (lines beginning with //) in the code and in the Explorer window (see Using comments). For example, you can search for any comments containing the string "To be verified".
Note: The end result of both types of searches depends on how the search mode (which) menu is set (see Search mode).
Language expression: Used to search for any valid 4D expression; the search is performed in the "contains" mode. Validity is important because 4D must be able to evaluate an expression to be able to search for it. For example, a search for "[clients" (invalid expression) will not return any result whereas "[clients]" is correct.
This option is particularly suitable for searches for value assignments and comparisons. For example: Search for "myvar:=" (assignment) Search for "myvar=" (comparison)
Language element: Used to search for a specific language element by its name. 4D can distinguish between the following elements:
Project method: Name of a project method, for example "M_Add". Note that this search (associated with the "is exactly" mode) is the equivalent of the Search references context command in the Method editor (see ).
Form: Form name, for example "Input". The command searches among project forms and table forms.
Field or Table: Name of a table or field, for example "Customers".
Variable: Any variable name, such as "$myvar".
Named constant: Any constant, such as "Is Picture".
String in quotes: Literal text constant; i.e. any value within quotes in the code editor or inserted into text areas of the Form editor (static text or group boxes). For example, a search for "Martin" will return results if your code contains the line: QUERY ([Customers];[Customers]Name="Martin")
Command: 4D command, for example "Alert".
Plug-in: Plug-in command installed in the application, for example "WR Find".
Anything: This option searches among all the objects in the Design environment. Only the modification date filter is available. Use this option, for example, to search for "all objects modified today".
The search mode menu (i.e. which, that is or whose name, depending on the type of search) specifies how to search for the value that is entered. The contents of this menu vary according to the type of element to search for as selected in the previous menu.
Search options for Text or Comment:
contains: Searches all the text of the Design environment for the specified string. Search results for "var" can include "myvar", "variable1" or "aVariable".
contains whole word: Searches all the text of the Design environment for the string as a whole word. Search results for "var" only include exact occurrences. They will not include "myvar" but will include, for example, "var:=10" or "ID+var" because the symbols : or + are word separators.
starts with / ends with: Searches for the string at the beginning or end of the word (text search) or at the beginning or end of the comment line (comment search). In "Text ends with" mode, searching for "var" will find "myvar".
Search options for Language element: The menu offers standard options (is exactly, contains, starts with, ends with) similar to the ones provided in previous 4D versions. Note that you can use the search wildcard (@) with the is exactly option (returns all objects of the type specified).
This menu restricts the search with respect to the creation/modification date of its parent (i.e., for example, the method containing the string being searched for). This menu contains standard date criteria (is, is before, is after, is not) as well as several new options to let you quickly specify a standard search period:
is today: Period beginning at midnight (00:00 h) of the current day.
is since yesterday: Period including the current day and the previous one.
is this week: Period beginning on Monday of the current week.
is this month: Period beginning on the 1st day of the current month.
You can select various options that can help speed up your searches:
Search in forms: When this option is deselected, the search is done throughout the database, except in forms and form names.
Search in methods: When this option is deselected, the search is done throughout the database, except in methods and method names.
Case Sensitive: When this option is selected, the search uses the case of the characters as they have been entered in the Find dialog box. Therefore, if you search for “MyVar,” 4D won’t find “myVar”.
An efficient search results from a judicious combination of the options of the Find and search mode (which) menus. To illustrate how searches work in 4D v12, below are a few examples of typical searches and how to configure them.
Search for all locations where a value was directly assigned to the vTInit variable:
Search for all references to the "Input" form of the [Customers] table:
Search for calls to any methods whose name starts with "HR_":
List all variables in the database:
Search for the "Designer" keyword in the comments written this week:
PROPERTIES
Product: 4D
Theme: Searching and replacing in the Design