English 中文(简体)
如何在德尔菲设定第二个参数?
原标题:How to give setter a 2nd parameter in Delphi?

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 =  ... );

我拥有公共财产:

property MySend: TTM_MySend_Profile displayLocateID  ... 
    read FMySend write SetMySend;

Can 我在这里作一个参数显示器,作为固定装置的第二参数? 我无法得到这一汇编。

我不能说出这样做的正确方法,并想知道我是否能够在德尔菲斯这样做。 帮助!

最佳回答

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.

你们需要做的是写一部专栏,为您的<代码>SetMySend功能提供额外的参数。

procedure SetMySend(const Value: TTM_MySend_Profile; 
    const displayValue: string); overload;
procedure SetMySend(const Value: TTM_MySend_Profile); overload;
property MySend: TTM_MySend_Profile read FMySend write SetMySend;

之后,在执行过程中,你写道:

procedure TMyClass.SetMySend(const Value: TTM_MySend_Profile);
begin
  SetMySend(Value,  ... );
end;

您可劫持index specifiers,以实施类似内容,但我不建议这样做。

问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签