我有一个类像这样
我想使用SetCodeInt过程来填充我的属性值,但是我遇到了问题。我该怎么办?
TuserClass = class
private
FUtilisateurCode: string;
FUtilisateurCle: string;
public
procedure SetCodeInt(ACode: string; AValue: string);
published
[CodeInt('2800')]
property UtilisateurCode: String read FUtilisateurCode write FUtilisateurCode;
[CodeInt('2801')]
property UtilisateurCle: String read FUtilisateurCle write FUtilisateurCle;
end;
procedure TuserClass.SetCodeInt(ACode: string; AValue: string);
begin
// what I want to is making this by RTTI to set good value to good CodeInt
if ACode = '2800' then FutilisateurCode := AValue
else if ACode = '2801' then FUtilisateurCle := AValue;
end;
我想使用SetCodeInt过程来填充我的属性值,但是我遇到了问题。我该怎么办?
SetCodeInt
的作用,尤其是因为您从未调用它。您需要修正您的问题,因为目前我们需要猜测您的意图。或许有人能够猜中,但我们不应该这样做。 - David Heffernan