Michael Van Canneyt wrote:
On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote:
procedure MyXYZPart.DoReport(aRep: IReportable);
begin
if (aRep <> nil) then begin
if (aRep is ILogged) then
(aRep as ILogged).Log(aRep.Report)
else
aRep.Report
end;
I see what you want, but if you would do
procedure MyXYZPart.DoReport(aRep: TInterfacedObject);
begin
if (aRep <> nil) and arep is IReportable then begin
if (aRep is ILogged) then
(aRep as ILogged).Log(aRep.Report)
else
aRep.Report
end;
you would have the same effect ?
Yes, in both cases, the compiler will stop because of a "begin"
without a "end". ;-)
More seriously, each time I see a "then begin", maybe I am wrong
but I immediately think that I have to deal with some code written
by a C programmer. And, curiously, I cannot find it reassuring.
mm
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal