Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using 4D Insider to document your database
PRODUCT: 4D Insider | VERSION: 6.0 | PLATFORM: Mac & Win
Published On: October 1, 1998

When a developer inherits a poorly documented project, some detective work may be needed to sort things out. For example, if you are handed an unlabeled collection of copies of a 4D database structure, how do you determine which is the most recent one? The modification dates of 4D database files are helpful, but not conclusive. Since this date is updated every time you open a database, it does not necessarily tell you which copy contains the most recent work. Also, when files are received as email attachments, some email software changes both the creation and modification dates of attached files to the date, they were emailed. To solve this puzzle, you can make use of the fact that most objects in a 4D structure have stored with them the date and time of the latest modification made in the Design environment. This time stamp is maintained for tables, forms, project methods, database methods, triggers, form methods, object methods, lists, menu bars, menus, library pictures, and tips. To view the modification date of a structure object from 4D Insider's browser window, double-click the object's name (or select the object's name, and press Enter). A section of the 4D Insider window then displays the contents of the object, and above that, an information bar includes the date of the last modification. These modification dates are also included in lists of objects printed from 4D Insider.

Rather than examining structure objects one by one, you can use 4D Insider to search for objects by the date of last modification. Select the Search item of the Tools menu. The left most pop-up menu of the Search dialog includes an option to search for structure objects by a specified date.

You can find objects whose date of last modification is equal to, less than, greater than, or different from your specified date.

Then you can examine these objects in 4D Insider's browser window to confirm which copy of the structure has the most recent modifications. (Keep in mind that other types of modifications, such as those made to the Database Properties dialog, are not included in the list of objects found by this 4D Insider search by date.)

The object modification dates can be helpful in other ways. Suppose you've redesigned the graphic style of a structure that contains many forms. By searching for forms last modified before the date you began your graphic overhaul, you can quickly find any forms you may have missed. Another scenario where this feature becomes very valuable is where, after making changes to a complex structure, you have a new problem with an old feature of the database. By searching for the most recent modifications, you can greatly narrow down the list of suspect changes. Only the date of the most recent modification to each structure object is stored in the structure-not the dates of all modifications to an object.

If you simply open and close an object, such as a method or form, just to look at it, without making any changes, the modification date of the object will not be changed. The modification date of all objects in the structure will be set to the current date if you convert a database from a previous version of 4D to 4D V6, or if you use 4D Tools to compact the database. If you use 4D Insider to copy objects from one structure to another, the modification date of the copied objects is set to the current date. The structure object time stamp feature of 4D cannot replace proper project documentation, but it gives you something helpful to fall back on when that documentation is not available.

With 4D Insider, you can add your own documentation to objects. For most of the objects contained in a structure or library in 4D Insider, you can click on the name of the object, then select the Edit Documentation item of the Tools menu, and a documentation window opens for the object, including both the date and time of the object's last modification. You can enter your own notes about the object into this documentation window, and the information will be saved in the structure of the database. The documentation for your objects can also be exported to a text file: choose Export from the File menu of 4D Insider, then select the Documentation check box in the Export dialog.

For more details, see the 4D Insider 6.0.5 manual, supplied in Adobe Acrobat PDF format on the 4D Product Line CD-ROM. In particular, see Chapter 3, Viewing Database Objects; Chapter 5, Searching and Replacing; and Chapter 8, Documenting Objects.