Delphi tips:

Show declaration of a Delphi identifier (routine, variable,...)

In Delphi's Code Editor, you can easily jump to the the declaration of an identifier (routine -- procedure or function, variable, constant, type,...). In the source code, right click on the identifier (name of the routine, variable,...) and click on Find Declaration in the popup menu that appears.

For this feature, Delphi must know where the identifier is declared:

  1. The declaring unit must be mentioned in a uses clause ( either near the top of the interface section of your unit, or near the top of the implementation section).
    For example, if you are looking for the declaration of the function DaysInAYear then one of the uses clause should include DateUtils, the unit where DaysInAYear is declared:
    unit Unit1;
    interface
    uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls,
      Forms, Dialogs, DateUtils;
  2. Delphi must have access to the source code of the unit where the identifier is declared. For identifiers that you declared yourself, that's not a problem, but for the "built-in" identifiers it depends on your version/edition of Delphi. Most Delphi versions have access to these source code files, but not all of the free "Personal" editions do (like for example D7 Personal). Luckily, it works well with the (free) Turbo Delphi Explorer

If you don't know where a certain routine is declared, put the cursor on the routine and press function key F1.
See also: Identifier Declarations.

 Related articles

Built-in identifiers
Where are built-in functions and procedures declared?
ref-identifier-declarations


 


DelphiLand Club Members of the DelphiLand Club receive our Crash Course Delphi, plus the fully commented source code of numerous projects, plus guaranteed answers from our Delphi Forum. Membership is for life!

TOP   DelphiLand Club Membership  DC Library  Forum  Forum Archives  Crash Course Delphi  Tips  Source Code  Downloads  Links