源码:
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SUIButton, ComCtrls, SUITreeView, ExtCtrls, SUIForm;type
  TForm1 = class(TForm)
    suiForm1: TsuiForm;
    Tree: TsuiTreeView;
    suiButton1: TsuiButton;
    procedure suiButton1Click(Sender: TObject);
    procedure DirToTreeView(Tree: TsuiTreeView; Directory: string; Root: TTreeNode; IncludeFiles:
  Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.suiButton1Click(Sender: TObject);
begin
  DirToTreeView(Tree: TsuiTreeView; Directory: string; Root: TTreeNode; IncludeFiles:
  Boolean);
end;
procedure DirToTreeView(Tree: TsuiTreeView; Directory: string; Root: TTreeNode; IncludeFiles:
  Boolean);
var
  SearchRec         : TSearchRec;
  ItemTemp          : TTreeNode;
begin
  with Tree.Items do
  try
    BeginUpdate;
    if Directory[Length(Directory)] <> '\' then Directory := Directory + '\';
    if FindFirst(Directory + '*.*', faDirectory, SearchRec) = 0 then
    begin
      repeat
        if (SearchRec.Attr and faDirectory = faDirectory) and (SearchRec.Name[1] <> '.') then
        begin
          if (SearchRec.Attr and faDirectory > 0) then
            Root := AddChild(Root, SearchRec.Name);
          ItemTemp := Root.Parent;
          DirToTreeView(Tree, Directory + SearchRec.Name, Root, IncludeFiles);
          Root := ItemTemp;
        end
        else if IncludeFiles then
          if SearchRec.Name[1] <> '.' then
            AddChild(Root, SearchRec.Name);
      until FindNext(SearchRec) <> 0;
      FindClose(SearchRec);
    end;
  finally
    EndUpdate;
  end;
end;end.
编译消息:
[Error] Unit1.pas(32): Not enough actual parameters
[Error] Unit1.pas(32): Statement expected, but expression of type 'Class reference' found
[Error] Unit1.pas(32): ':=' expected but ':' found
[Error] Unit1.pas(32): ')' expected but ':' found
[Error] Unit1.pas(32): Statement expected, but expression of type 'Class reference' found
[Error] Unit1.pas(32): ':=' expected but ':' found
[Error] Unit1.pas(33): '(' expected but ')' found
[Error] Unit1.pas(15): Unsatisfied forward or external declaration: 'TForm1.DirToTreeView'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
  第一条<<没有足够的实参>>怎么解决?

解决方案 »

  1.   

    你的源码的确是这样??procedure form1.DirToTreeView(....//那这里应该有form1.的;
    你只需要在声明的过程上按ctrl+shift+c,会自动生成模板的。其他地方没仔细看
      

  2.   

    sorry!!应该是TForm1.DirToTreeView。。
      

  3.   

    你调用函数出现了问题
    procedure TForm1.suiButton1Click(Sender: TObject);
    var 
      RootNode:TRootNode;
    begin
     { DirToTreeView(Tree: TsuiTreeView; Directory: string; Root: TTreeNode; IncludeFiles:
      Boolean);}  DirToTreeView(应该是控件对象,目录,跟节点,布尔值);end;
    你没有对过程的参数赋值