This is news to me and I've also been coding in Delphi for about 10 years.
I don't think it's a good idea to use it as it confuses class completion (not to mention me), and doesn't work with overloaded methods (unsurprisingly) - there are probably other problems, but they will probably take more than 3 minutes to discover ;-)

Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington


Myles Penlington wrote:

It’s always been that way, ie. The defn in the interface rules.

I think by convention, people duplicate the parameters on the impl.

Myles.

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Stacey Verner
*Sent:* Friday, 11 April 2008 10:21 a.m.
*To:* NZ Borland Developers Group - Offtopic List
*Subject:* [DUG-Offtopic] Delphi Oddness

I have been using Delphi for nearly 10 years and today I discovered something new, and very strange.

You can omit the parameters in the implementation of a method.

interface

type

TTest = class

public

procedure Test(AParameter: String);

end;

implementation

procedure TTest.Test;

begin

// This works, but it has the parameter "AParameter: Integer".

ShowMessage(AParameter);

end;

Any thoughts on why?

To me this could make the code difficult to understand.

I checked and it doesn’t work if you include empty brackets like "procedure TTest.Test();".

Stacey

Stacey Verner Ph: +64-9-4154790
Software Developer Fax: +64-9-4154791
DDI: +64-9-4154797
Email: [EMAIL PROTECTED] <BLOCKED::mailto:[EMAIL PROTECTED]>

CJN Technologies Ltd.

PO Box 302-278, North Harbour, Auckland 0632, New Zealand
12 Piermark Drive, North Harbour, Auckland, New Zealand
Visit our website at http://www.cjntech.co.nz/ <BLOCKED::http://www.cjntech.co.nz/>

Attention:
This communication is confidential and may be legally privileged. If you are not the intended recipient, please do not use, disclose, copy or distribute it, other than to return it to us with your confirmation that it has been deleted from your system.
------------------------------------------------------------------------

_______________________________________________
NZ Borland Developers Group Offtopic mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/offtopic
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
_______________________________________________
NZ Borland Developers Group Offtopic mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/offtopic
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to