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

提示'.' exoected but '(' found,该怎么解决

2012-03-31 
提示. exoected but ( foundprocedureTForm1.GetFile(PathName:string)varFindData:TWin32FindDatah

提示'.' exoected but '(' found
procedure TForm1.GetFile(PathName: string);
var 
  FindData: TWin32FindData; 
  hf:THandle; 
  b:boolean; 
  tmpstr:string;
  tempFolder:string; 
  str:string; 
begin 
  hf := Windows.FindFirstFile(PChar(PathName + '\*.* '), FindData);
  if hf = INVALID_HANDLE_VALUE then exit;
  b := true; 
  while b do 
  begin 
  if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then 
  begin
  str:=string(FindData.cFileName);
  if (Pos('test.doc', str)> 0 ) or (Pos('test.doc',str)>0) then
  begin
  showmessage(PChar(PathName+'\'+string(FindData.cFileName)));
  DeleteFile('c:\test.doc');
  //DeleteFile(PChar(PathName+'\'+string(FindData.cFileName)));
  end; 
  end 
  else 
  begin
  tmpstr := FindData.cFileName + ''; 
  if (tmpstr <> '.') and (tmpstr <> '..') then
  begin 
  tempFolder:=tempFolder+string(FindData.cFileName)+ '\';
  GetFile(PathName + '\' + FindData.cFileName); 
  end; 
  end;
  b := windows.FindNextFile(hf,FindData); 
  end; 
end; 
以上代码执行时,老是提示提示'.' exoected but '(' found的错误,请教各位大虾,谢谢!

[解决办法]
不是这段代码的事,查查别的代码是不是多了end

热点排行