Board index » delphi » Re: Delphi newbie needs help with derived class calling baseclassprocedure

Re: Delphi newbie needs help with derived class calling baseclassprocedure


2005-06-10 12:40:39 AM
delphi114
Steve Alpert writes:
Quote
Let me be as precise as I can...
Class A is provided by another and we don't want to edit it if we can
avoid it.

in unit A:
type F1 = class(TForm)
procedure ProcA;
...

in unit B:
uses A;
type F2 = class(F1)
procedure ProcB;
...

implementation

procedure F2.B(Sender: TObject)
var ...
begin ...
{want to call F1.ProcA here...}
ProcA;

Error is undeclared identifier ProcA
Ditto for F1.ProcA
Part of being "as precise as I can" involves showing your *real* code.
Copy and paste. The code you've provided is obviously not your real code
because the method names don't match. If you need to, post an entire
sample project to the attachments group. Without your real code, the
best answers you get will just be guesses. (They might be _good_
guesses, but no one will be able to answer you with any certainty.)
My guess is that ProcA is declared with private visibility. (In the code
you've shown, it is declared with published visibility, but I can not trust
the accuracy of your code.)
My next guess is that ProcA isn't really a member of the F1 class at all.
My third guess is that you're spelling the method name wrong when you
try to call it.
--
Rob
 
 

Re: Delphi newbie needs help with derived class calling baseclassprocedure

Quote
I suspect that declaring a procedure, like ProcA below,
is implicitly private
It's implicitly published, IIRC
Cheers,
Jim Cooper
__________________________________________
Jim Cooper XXXX@XXXXX.COM
Tabdee Ltd www.tabdee.ltd.uk
TurboSync - Connecting Delphi to your Palm
__________________________________________