Mega Code Archive

 
Categories / Delphi / Examples
 

Allowing delphi to remove your empty methods

By default, Delphi removes any empty event handlers each time your save or rebuild your application. However, you may have noticed that it doesn't remove your methods--even if they're empty. The secret to this phenomenon is that Delphi places event handlers in the published section of the form's class declaration. (This is the section between the classname specifier and the private section of the class declaration.) If you place your methods in the same section of the class declaration, as shown below, then it will not remove your method, even if empty. type TForm1 = class(TForm) procedure MyProc; private { private declarations } public { public declarations } end;