다음과 같은 것이 있습니까?
원본 방법 : -
method Something.SomeMethod(a:Integer;b:Integer;c:Integer): Integer;
begin
result:=b+c;
end;
새로운 방법 -
begin
if (a > 0) then
begin
result := (b + c);
exit
end;
begin
result := 1000;
exit
end
나는 내 문자열을 사용하려고하면 그 방법의 수준 측면이
[AttributeUsage(AttributeTargets.Method)]
Class1Attribute = public class(System.Attribute,
IMethodImplementationDecorator)
private
protected
public
method HandleImplementation(Services: RemObjects.Oxygene.Cirrus.IServices; aMethod: RemObjects.Oxygene.Cirrus.IMethodDefinition);
end;
implementation
method Class1Attribute.HandleImplementation(Services: RemObjects.Oxygene.Cirrus.IServices; aMethod: RemObjects.Oxygene.Cirrus.IMethodDefinition);
begin
var newVersion:=new ResultValue();
var newAssignment:=new AssignmentStatement(newVersion,new DataValue(1001));
var p1:= new ParamValue(0);
aMethod.SetBody(Services,method
begin
if (unquote<Integer>(p1)>0) then
begin
Aspects.OriginalBody;
end
else
begin
unquote(newAssignment);
end;
end);
end;
과 같을 것이다 Datavalue (대상 함수는 문자열을 반환합니다.) 내부 오류가 발생합니다. 문자열을 사용하는 경우이 코드를 업데이트해야합니까? – jamiei
SomeMethod가 문자열을 반환하고 새 DataValue의 매개 변수도 문자열이어야합니다. – Mosh
AssignmentStatement를 인용 부호로 묶을 때 문자열로 바꿀 때 RemObjects.Oxygene.targets에서 (CE7) 내부 오류 (D03)가 발생합니다. 정확히 DataValue()가 수행하는 작업은 무엇입니까? – jamiei