德尔福RTTI设定值I类有这样根据属性值
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是什么是有点困难的。尤其是因为你从不称呼它。你需要解决你的问题,因为它目前需要我们阅读你的想法。也许有人能够做到这一点,但我们不应该这样做。 –
我更新我的问题,明确我想做什么 –