function GetAllChild(ID:Integer;out childList:TStrings):Boolean;<br>var<br> I,J,nIndex:Integer;<br> IsExists:Boolean;<br>begin<br> IsExists:=False;<br> nIndex:=-1;<br> For I:=0 to Length(PIDARY)-1 do //判断是否存在<br> begin<br> if (PIDARY = ID) then<br> begin<br> IsExists:=True;<br> nIndex:=I;<br> Break;<br> end;<br> end;<br> if IsExists then<br> begin<br> childList.Add(IntToStr(IDARY[nIndex])); //找到一个<br> GetAllChild(IDARY[nIndex],childList);<br> end<br> else<br> Result:=True;<br>end;