PDA

View Full Version : Interface <> Implementation



Thyandyr
24-05-2017, 07:39 PM
interface

type
TForm2 = class(TForm)
procedure Shaders(var aShaderProgram: glUInt);
...

implementation

procedure TForm2.Shaders;

How come it is possible that I can compile and run this?

de_jean_7777
24-05-2017, 10:40 PM
Afaik, tp, delphi and fpc in delphi mode allow to not have to specify the parameters again in the implementation section. That is, if there is only one method of that name. If you have multiple overloaded methods of the same name then it won't compile.

Thyandyr
25-05-2017, 10:29 AM
I never knew that!

SilverWarior
25-05-2017, 02:56 PM
I also didn't knew that and I have been using Delphi for over 10 years now.