测试半天,原来是因为这个原因。下面例子中,Result:=''必须写,否则其结果会被累计,真是昏倒!!

function MyPaths(tache: IXMLTaskType) : String;
var
i: integer;
begin
result := '';
for i := to task.paths.Count - do
begin
if task.paths.path[i].folder<>'' then
result := Result + task.paths.path[i].folder+#;
end;
end;
04-28 17:15