想不到付分后还可以检分:
我的帖子:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1442444
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TBook.ListAllSubNode(Code: string;Node:TTreeNode);
var
LevelNum : integer;
CurrentNode : TTreeNode;
CurrentCode : string;
BookName : string;
//BookQuery : TQuery;
SavePlace : TBookMark;
CurrentLevel: Integer;
begin
SavePlace := nil;
if LibDM.Book.Active = False then
LibDM.Book.Active := True;
//ookQuery.Database := LibDM.
LibDM.Book.First();
LevelNum := GetLevelNum(Code, '222');
while not LibDM.Book.eof do
begin
CurrentCode := LibDM.Book['book_ID'];
BookName := LibDM.Book['Book_Name'];
CurrentLevel:= GetLevelNum(CurrentCode, '222');
if (CurrentLevel = LevelNum+1) {如果处于下级} then
if ComparePrefix(Code, CurrentCode) then
if (ComparePrefix(Code, CurrentCode)){LevelNum级前的代码相同} then
begin
SavePlace := LibDM.Book.GetBookmark;
CurrentNode := ArchTree.Items.AddChild(Node, CurrentCode+'->'+ BookName);
if CurrentLevel < 3 then
begin
ListAllSubNode(CurrentCode, CurrentNode);
if SavePlace<>nil then
LibDM.Book.GotoBookmark(SavePlace); //为了这句代码的正确位置,我花了一个晚上加一个早晨,我激动不已,我对前途............. end;
end;//
LibDM.Book.Next();
end;
end;
//我将这段代码贴出来,也是想抛砖引玉,换取更好的代码
//虽然还有些子程序没贴出来,只要大家要,我会公布的