IDE Window: Unit info

From Lazarus wiki
Revision as of 22:23, 9 May 2006 by Mattias2 (talk | contribs)
Jump to navigationJump to search

This dialog shows various information of the current file in the source editor.

General

  • Name: the unit name as written in the source code. Otherwise it is the filename without extension and path.
  • Type: The highlighter type. This can be changed via the popup menu of the source editor.
  • in Project: If the file is part of the project. This can be changed in the project inspector or the Project -> Add to project/remove from project menu items.
  • Size: size of the file in bytes
  • Lines: number of source lines.
  • Path: Full file name.
  • Included by: This file was included last time by this source file. For example via an {$I filename.inc} include directive. This is automatically set each time the IDE parses the unit containing the include directive. You can clear this with the Clear button. You can use Search -> Goto include directive to jump to the include directive of the parent file.
  • Clear: This button clears the 'Included by'.

Unit paths

These are the unit paths used by the IDE for this file. The unit paths are used to search for .ppu, .pas, .pp, .p files. Normally these paths are give to the compiler. But there are cases where this is not the case. And it does not show the unit paths defined in the compiler config file (fpc.cfg).

These paths are created by the rules in the Environment -> CodeTools defines editor. All files in a directory share the same search paths (unit paths, include paths, ...). If this a project directory, all project unit paths are added. If the directory belongs to a package its unit paths will be added. If you put a project and a package into one directory, both paths will be added. That it why it is recommended to give packages and projects directories of their own.

Difference between compiler search paths and IDE search paths: Normally the difference does not matter. The compiler is invoked in one directory with a set of search paths. For example: There are 4 packages:

 /home/user/package1/package1.lpk
 /home/user/package2/package2.lpk
 /home/user/package3/package3.lpk using package1 and package2
 /home/user/package4/package4.lpk using package1 and package2

When package3 is compiled in /home/user/package3 with unit path /home/user/package1/;/home/user/package2/. When the compiler finds a unit in /home/user/package2/ and compiles it it applies all unit paths, including path to /home/user/package3/. When the compiler is invoked for another package4 it will be started in a different directory with different search paths. For example in /home/user/package4 with unit path /home/user/package2/;/home/user/package3/. When the compiler finds a unit in /home/user/package2/ and compiles it it applies all unit paths. This means the compiler

The IDE

Include paths

Source paths