An advanced search tool for names of files and Visual FoxPro classes in projects or folders.
Getting Started: Like all VFPX projects, Finder can be downloaded using Thor. If you have Thor installed, Finder shows up in “Check For Updates”. If not, see Thor installation instructions.
Then watch the Finder introductory video.
Note that Finder requires that Thor be active in order to work, as it is based on various Thor components.
It looks a lot like GoFish! This is by design. Finder and GoFish are companion search engines. Both search VFP projects or folder/sub-folders, looking for different types of matches
- Finder searches for names of files or classes.
- GoFish searches for references in code.
Tooltips and context menus: Tooltips have been used fairly extensively, and the context menu on the rows in the grid provides a number of different options depending on the type of file selected.
Timestamps for SCXs, VCXs, and Classes: The timestamps displayed for SCXs and VCXs do not show the timestamp of the last time the file was changed (which may have occurred when building a project) but instead the most recent timestamp from the rows in the SCX/VCX. Similarly, the timestamps for classes are based on the most recent timestamp from the rows for the class.
Source Control: The options form, shown below, gives an option so that you will be asked whether you want to check out a file (if Source Control is used in the current project) before opening.
Other Source Control-related options may be added at a later date if there is interest.
(See further discussion of this at the very end, under the topic MRU Lists)
Basic Searching
The most basic and also most commonly used form of searching is to enter part of a file name or class name. The result is all files or classes where the entered text is part of the name. You can use wildcards (‘?’ and ‘*’) in your search. Searching is done by assuming a leading and trailing ‘*’ and using the LIKE() function.
You can search for all file or class names by simply leaving the search field blank.
Advanced Searching
To find names beginning with text you enter, begin with ‘^’.
To find names ending with text you enter, end with ‘$’.
To find exact name matches with the text you enter, use ‘!’ at the beginning or end.
Searching for File Name Extensions
To restrict your search to a particular file name extension, enter a dot and the extension after the search text. For example, “JOB.PRG” would find all PRG files that contain the text “JOB”
You can use wildcards when specifying an extension. “JOB.?CX” would search all forms and class libraries.
You can search multiple file extensions by entering each of them, separated by dots. Thus, you could also search all forms and class libraries by entering “JOB.SCX.VCX”
Searching Path Names
To search for names that are part of the full path for a file, follow the path name with ‘\’. For instance, searching for Job\Show will find all files where Job is part of the the path name and Show is part of the stem name. The actual search phrases used is *JOB*\*SHOW*.*
To search for all names in a particular folder, enter the folder name followed by ‘\’.
Examples:
SHOW == *SHOW*.*
SHOW.SCX == *SHOW*.SCX
'\' means you are searching the path as well, and is interpreted as *\*
JOB\ == *JOB*\*.* Entire folder
JOB\SHOW == *JOB*\*SHOW*.* All files in JOB folder with SHOW in name
JOB\.SCX == *JOB*\*.SCX All SCX files in JOB folder
Scope
The scope for your search may be either a project (which need not be open) or a folder (including sub-directories). The drop-down list shows a MRU list of projects and folders. In the options form you can also create a “Favorites” list of projects and/or folders to appear in this drop-down list.
Operations on Files or Classes
The original concept of this tool was to provide a simple mechanism for finding and opening files. Double-clicking any row in the grid will open the selected file or class. The underlying mechanism here is the FoxPro function EditSource(). There are a few other things that occur when the file is opened:
- The file is opened using the same case as the file name on disk, so the case of the file name will not be changed.
- The file is added to the appropriate FoxPro MRU list. Other Thor tools allow you to access these lists without visiting the command window.
- If you use Source Control, you can use the Options form to indicate that you want to be asked to check out files from Source Control before opening them.
You can also right-click on any row in the grid for a context menu. This items in this menu are sensitive to the extension of the file or class selected, and may include any of these options:
- Open (same as Dbl-Click)
- Run (for PRGs, SCXs, and FRXs)
- Open with HackCX (this option is always available but only works if HackCX is installed)
- Create VCA/SCA/etc. file using SCCTextX
- Pack
- Modify Structure
- Reindex
- Look up Reference (if GoFish is installed – finds all references to the form/class)
- NewObject (inserts call to Object)
- Create subclass
- Create duplicate class
- Descendant Classes
- Sibling Classes
- Where Used (where this class or its descendant classes are used)
- Add to or Remove from current project
- Open folder in Explorer
- CD to this folder
- Set scope to this folder
PRG-based classes
Finder locates classes that are defined in PRG and handles them just as it handles visual classes in VCXs
Sorting or filtering the Grid
You can sort the grid by clicking on a column header.
You can filter the rows in the grid by right-clicking in a column header (other than the timestamp or size columns).
Drag/Drop classes
When you have searched for classes, you can drag the class from the current highlighted row in the grid and drop it on a form or class you are editing. You can begin dragging it by either:
- Dragging the icon that appears just above the upper left hand corner of the grid.
- Or holding down the Shift or Ctrl key and dragging the row from the grid.
You can then drop the class onto a form or class you are editing, just like you do from the Class Browser. If the object under the mouse is a container, the class is added as a child object in the container, else it is added as a sibling.
As an alternative, you can also drop the class on PEM Editor. In this case, the object is added as a child or sibling of the object that is current displayed in PEM Editor. This makes it very easy to drop classes into hard to get at places, such as columns in a grid or containers that are obscured in the form/class being edited. Simply navigate to the container object (using PEM Editor, Property Window, etc.) and then drop the class onto PEM Editor.
Persistence of Settings
Most of the settings of the form persist from session to session, including its size and position, search text, scope, column widths and order, the results grid, and the current row in that grid
Dockable vs not-dockable
By default, the form is dockable. This choice was not made because of the expectation that the form will ever be docked, but rather because of three effects of making it dockable.
-
When opened, it goes on top of all other forms, including other dockable forms.
-
It can be moved outside the visible FoxPro screen
-
The setting for Dockable can be turned off by right-clicking the titlebar of the form
You can turn off the Dockable setting, allowing the form to go behind other non-dockable windows, if desired, as long as you are careful to do so when the form is within the FoxPro screen and is not on top of a dockable window.
MRU Lists and Source Control
As noted earlier, any file opened is automatically added to the appropriate FoxPro MRU list, as if it had been opened from the command window. These MRU lists can be accessed by right-clicking on either the “File Search” button (for files) or the “Class Search” button (for classes and class libraries).
MRU lists are not kept current when files are opened from either the Project Manager or the Class Browser (an unfortunate oversight). However, this can be corrected by using files found in folder Thor\Tools\Samples:
- Class Library ‘BaseProjectHooks.VCX’ contains a class that can be used as a ProjectHook for a project. If you are already using a ProjectHook class, you can simply use the QueryModifyFile method from this class.
- File ‘Browser.APP’ can be used to replace the file of the same name in Home(1).
If you are using Source Control in the current project, each of these replacement programs will also ask whether you want to check out the file before opening it.