Here's how I'd do it: Make an small program that does the following:

(1) Gets the list of files in your project's directory, without extension (it's 
simpler that way).
(2) Loop over the list of files; Check if both the .PAS and .DFM file variants 
exist.
(2.1) If both variants exists open the .PAS file in a TStringList, look for a 
line that ends in "class(TForm)"; If you've found a line like that then you 
know the file is for a form (not for a frame or data module).
(2.2) Now look at every line in the PAS file for the "procedure 
FormCreate(Sender: TObject);" line (and for the FormDestroy equivalent). Do 
they exist?
(2.3) Open the DFM file in a TStringList and look for the "OnCreate = " and 
"OnDestroy = " lines. Do they exist?
(2.4) Make a list with all the files that included the "class(TForm)" in PAS, 
included the "FormCreate" in PAS and do not include "OnCreate" in the DFM!

> -----Mesaj original-----
> De la: [email protected] [mailto:delphi-talk-
> [email protected]] În numele SoftTech
> Trimis: Monday, January 04, 2010 8:13 PM
> Către: Delphi - Talk
> Subiect: Tool to find un-linked event in delphi source
> 
> Greetings All and Happy New Year,
> 
> Working with Delphi 5.1 currently and moving to Delphi 2010 this year.
> 
> Does anyone know a tool or any way to find un-linked events?
> 
> I have an issue where I have events that were once setup say onCreate
> and
> OnDestroy that have code in the source form, but if you open the object
> inspector they do not show they are linked.  I know how this happened,
> but I
> have 786 forms in my project and not all of them are un-linked.  I do
> not
> want to have to open every single form and look at the object inspector
> to
> see if they are linked.
> 
> So any tools are ideas how to check this and create a report of in-
> linked
> events?
> 
> Thanks for all who reply,
> Mike
> 
> 
> 
> __________________________________________________
> Delphi-Talk mailing list -> [email protected]
> http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

Reply via email to