I make the following simple distinction when adding units to the interface and implementation uses lists:
If the unit is required for the interface (i.e. class, method and variable declarations etc.) I add the unit to the former uses list.
If the unit is required only for the implementation of the class and/or methods then I add it to the latter uses list.
This particularly applies when I get an "Undeclared Identifier" compilation error. I see whether the highlighted line is in the interface/implementation section and then add the appropriate unit to whichever section contains the error.
-----------------------------------------------------------
Example
I get the following message:
[Error]Unit1.pas(37): Undeclared identifier: 'IntToStr'
I then double-click the error line and the offending line is highlighted in the Code Editor.
I notice the line is in the Implementation section, so I add "SysUtils" to the Implementation Uses list.
-----------------------------------------------------------
I also add a carriage return in each uses list between Delphi units and my own units - this is something I choose to do so that I can clearly see dependencies to Delphi units and my own.
Hope this helps!
Clive
![[infinity] [infinity] [infinity]](/data/assets/smilies/infinity.gif)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096