递归的使用



var
iFindRec, iParentRec: IGSPRecord; begin Result := -1; iFindRec := FSection.FindByID(ASectionID); if not Assigned(iFindRec) then Exit; iParentRec := iFindRec.FindField(pfnPID).MasterRecord; while iParentRec <> nil do begin iFindRec := iParentRec; iParentRec := iFindRec.FindField(pfnPID).MasterRecord; end; Result := iFindRec.ID; end;

 

posted @ 2012-05-21 18:04  谷雨·  阅读(154)  评论(0编辑  收藏  举报