May 11th, 2012, 01:36 PM
Join Date: Jun 2008
Time spent in forums: 3 Days 9 m 16 sec
Reputation Power: 6
Originally Posted by dlumley
Hi, I'm busy learning Delphi and using the ImageEn component...
I've noticed in the source code in their examples the call to a function like this:
is the object with ImageAtPos
being a function...
My question is why is there no period separating the function and the object? I would have thought this to be needed?
i.e. TMainForm.ImageEnMView1.ImageAtPos (which throws an error) this is probably fundamental but your answer will help me to further my Delphi :-)
Thank you in advance.
I don't use ImageEn, so my answer will not be specific to that component, but in context here, the "Object" is the form which is referred to by TMainForm and the Method is ImageEnMView1ImageAtPos
If you look within the type declaration at the top of your source code, you should see something like this:
TMainForm = class(TForm)
procedure ImageEnMView1ImageAtPos(<params if any>);
then the procedure body would be defined in the implementation section
If you add a BitBtn to your form, and add a OnClick handler, the method added to your form class would be:
procedure BitBtn1Click(Sender: TObject);
and in the implementation would be