I want to know whether we can do such in Delphi:
I have a private procedure:
procedure SetMySend(const oValue: TTM_MySend_Profile;
displayValue: string = '...');
I have a public property:
property MySend: TTM_MySend_Profile displayLocateID '...'
read FMySend write SetMySend;
Can I give a parameter displayValue here as the 2nd parameter of the setter? I cannot get this compiled.
I cannot figure out the correct way to do it and wonder whether I can do this in Delphi. Thanks for help!
A property setter for a property takes only one parameter, of the same type as the property. There is no syntax that would allow you to write the type of code you are attempting to write. Note that I am ignoring array properties which are not pertinent here.
What you need to do is to write a dedicated setter which supplies the extra parameter to your
SetMySendfunction.And then in the implementation you write
You could hijack index specifiers to effect something similar, but I would not recommend that.