Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delphi-shortcut to implement interface method and abstract method from ancestor interface or class

I have example code like this

IExample=interface
   procedure Test;
end;

TBaseClass=class
   function Check:boolean;abstract;
end;

TExampleObject=class(TInterfacedObject,IExample)
end;

TAnotherObject=class(TBaseClass)
end;

My question is, how I can implement interface method and abstract method from ancestor?

I use Visual Studio and C#, very simple to make implementation from abstract method and interface method, I just right click on my class, and Implement method.

Does RAD Studio XE2 have similiar tool or third party tool that have same function? because is annoying if I must write down all abstract and interface method manually

like image 537
navirius Avatar asked Dec 07 '25 10:12

navirius


1 Answers

I suppose there are IDE plugins out there that offer the functionality you want.

I use this method every day:

Copy the methods from your interface to the public section of your class, set cursor on one of these methods and execute shortcut CTRL-SHIFT-C. Delphi will automagically create the functions/procedures in the implementation section for you!

This works for all classes...

like image 53
whosrdaddy Avatar answered Dec 10 '25 08:12

whosrdaddy