Uses Units Tools

Uses Units Cleaner

This tool is used to remove the unused reference units in 'uses' part. Only Delphi is supported now.

When a component is put into form in design time, the units which contains the component will be added into uses part automatically. But NO removing when component is removing. This tool can search the uses part and analyze them to list the possible unused reference units to clean.

The dialog is shown as below:

Content and Clean Settings:

- Current Unit: Search current unit.

- Opened Units in Current ProjectGroup: Search opened units in current ProjectGroup.

- All Units in Current Project: Search all units in current project.

- All Units in Current ProjectGroup: Search all units in current ProjectGroup.

- Include Indirectly Used Units: If checked, uses cleaner will process the indirectly used units with source, not only in Project or ProjectGroup.

- Skip Used Units including Initialization Part: Whether skip those units which contain initialization part in searching. The part may contains some initialization operations and removing the reference may cause problems.

- Skip Used Units including Register Procedure.: Whether skip those units which contain Register procedure in searching. This procedure may contain component register content.

- Skip Used Units Refered by Component Indirectly.: Whether skip those units which refered by component indirectly, such as ancestor definitions or components in other forms.

- Skip Used Units without Source: Whether skip those units without source code in searching.

- Auto Save/Close Unopened Files: Defaultly, this tool will open files in IDE and do the file changes without saving and close. It will cause memory exhausted when meeting huge project. If this option checked, this tool will auto save and close file after processing and can't undo the change.

- Clean Units Directly: Clean the units below directly.

- Skip Units Directly: Skip the units below directly. They're almost system units.

- Process: Search unused reference units according to the settings.

- Cancel: Close this window and DO NOT clean.

- Help: Show this help.

Uses Units Cleaner Scan Result

After you click the 'Process' button. This tool will compile current content and search and list the result in a treeview as below. The checked units are those can be cleaned. You can confirm or discard them. The unchecked units are already skipped by some settings.

- Clean: Remove the checked reference units.

- Cancel: Close this window and DO NOT clean.

- Help: Show this help.

Uses Initialization Tree

This tool can analyse compiled units in project and list their initialization order into a tree with location type and uses type.

The window is shown as below, including initialization tree, display filter and unit information.

- Exit: Close this Window.

- Project: Choose project to analyse. Default is current project.

- Analyse Project: Press this button to compile and analyse dcu files to generate the initialization tree.

- Export: Save tree content to a text file.

- Open: Open selected source file in IDE.

- Open in Explorer: Open windows explorer and locate selected file.

- Search: Show search dialog to search text in tree.

- Search Next: Repeat search for previous text.

- Help: Show this Help.

- Units in Project Search Path: Whether show units in Project Search Path to tree.

- Units in System Search Path: Whether show units in System Search Path to tree.

Use Unit from Identifier

This tool can analysis all dcu files in library and obtain exported symbols for Searching and use. You can select a unit from list and add it to interface or implementation part in current source file.

The window is shown as below.

- Use Selected Unit: Use selected unit for Current Unit in IDE.

- Open: Search and Open selected Source File in IDE.

- Copy Selected Unit Name to Clipboard: Copy selected unit name to clipboard.

- Match Identifier Start: Match the identifier head when searching.

- Match All Parts of Identifier: Match any position of identifier when searching.

- Fuzzy Match of Identifier: Fuzzy Match of identifier when searching.

- Font: Change font of list.

- Help: Show this Help.

- Exit: Close this Window and Exit.

Links

Basic Operation

CnWizards Settings

About CnWizards

Copyrights 2001-2025 CnPack Team