🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.opentoolsapi
1 messages
1 total messages Started by Ilya.Kuksin Wed, 23 Jan 2008 04:46
How to get list of used units not listed in dpr uses list?
#120
Author: Ilya.Kuksin
Date: Wed, 23 Jan 2008 04:46
59 lines
2796 bytes
Hello.

Sorry for my terrible english :(

We have some big projects in Delphi 5, and we want to use Delphi 7
instead of Delphi 5 now. This projects use one unit (for example,
OutVariants.pas), that include a function VarToDateTime (function
VarToDateTime(const Value: Variant): TDateTime;). Using of Delphi 5
doesn't cause any problem (because such function declared in
System.pas), but Delphi 7 does. I cannot control order of
"OurVariants" and "Variants" in uses list, and cannot control usage
OutVariants.VarToDateTime form, so we have such solution:
  1. Rename out function
  2. Write an Expert (Wizard), that executes at
IOTAIDENotifier50.BeforeCompile and searches for units with
"VarToDateTime(" string. Compilation is not allowed until this string
gone.

The question is: how can I found ALL units, compiled with project?
Units in project (uses in dpr) - not a problem

procedure TIDENotifier.BeforeCompile(const Project: IOTAProject;
var
  MI : IOTAModuleInfo;
  I : Integer;
begin
  for I := 0 to Project.GetModuleCount - 1 do
  begin
    MI := Project.GetModule(I);
    ProcessUnit(MI);
  end;
  ....
end;


But what about units, added to uses list in another units? Can I use
OTA to get uses lists of that units or get full units list in another
way?

-------------------------
program Test;

uses
  MyBaseUnit;

begin
  //Some code here
end.
-------------------------------
unit MyBaseUnit;

interface

uses AnotherUnit;

//some code here
------------------------------

I have to find AnotherUnit.pas. How can I do that?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads