首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

[Error] Unit1.pas(78): Types of actual and formal var parameters must be identic

2012-02-09 
[Error] Unit1.pas(78): Types of actual and formal var parameters must be identicvarForm1: TForm1Se

[Error] Unit1.pas(78): Types of actual and formal var parameters must be identic
var
  Form1: TForm1;
  Searched : Boolean;
implementation
type
  TSearchRec = record
  Fill: array[1..21] of Byte;
  Attr: Byte;
  Time: Longint;
  Size: Longint;
  Name: String[12];
end;
{$R *.dfm}



procedure TForm1.FileListBox1Click(Sender: TObject);
begin
  if Searched then Exit;
  Searched := False;
  ListBox1.Items.Clear;
  Listbox1.Items.Add('下列文件为选定文件');
  Listbox1.Items.Add(ExtractFileName(FileListBox1.FileName));
end;

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
  FileListBox1.ApplyFilePath(Edit1.Text);
  Key := #0;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
  SearchRec : TSearchRec;
begin
  Searched := True;
  ListBox1.Items.Clear;
  ListBox1.Items.Add('下列文件为查找到的文件');
  FindFirst(Edit1.Text,faAnyFile,SearchRec); 还有这行
  ListBox1.Items.Add(SearchRec.Name); 
  Repeat
  i:= Findnext(SearchRec); 出错的就是这行
  if i = 0 then
  ListBox1.Items.Add(SearchRec.Name);  
  until i <> 0;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  close;
end;

end.

高人求救 网上的程序都是这样写的

[解决办法]
type
TSearchRec = record
Fill: array[1..21] of Byte;
Attr: Byte;
Time: Longint;
Size: Longint;
Name: String[12];
end;

把这个定义删掉了就可以啦!在SysUtils单元已经有TSearchRec的定义啦!

热点排行