下面是我学习delphi时遇到的一段程序代码,我不清楚代码的意思,请帮忙讲解一下!
procedure TForm1.Button1Click(Sender: TObject);
 var
    sr:tsearchrec;
    fileattrs:integer;
begin
     stringgrid1.RowCount:=1;
     if checkbox1.Checked then
        fileattrs:=fareadonly
     else
         fileattrs:=0;
     if checkbox2.Checked then
       fileattrs:=fileattrs+fahidden;
     if checkbox3.Checked then
       fileattrs:=fileattrs+fasysfile;
     if checkbox4.Checked then
       fileattrs:=fileattrs+favolumeid;
     if checkbox5.Checked then
       fileattrs:=fileattrs+fadirectory;
     if checkbox6.Checked then
       fileattrs:=fileattrs+faanyfile;
     if checkbox6.Checked then
       fileattrs:=fileattrs+faarchive;
     
  with stringgrid1 do
     begin
          rowcount:=0;
            if findfirst(edit1.Text,fileattrs,sr)<>0 then//这个地方不知道该是什么符号,不管时=、<>都不懂!
              begin
                 Cells[1,0]:='文件名';
                 Cells[2,0]:='大小(k)';
              repeat
              if(sr.Attr and fileattrs)=sr.attr then
     
                 begin
                    rowcount:=rowcount+1;
                    cells[1,rowcount-1]:=sr.Name;
                    cells[2,rowcount-1]:=inttostr(sr.Size);
                 end;
                  until findnext(sr)<>0;//这里也是同样不理解,到底0是真还是假,请告知!
                     findclose(sr);
               end;
       end;
end;

解决方案 »

  1.   

    <>  是不等于,和C中的 != 一样。
      

  2.   

    这还要问, 晕FindFirst & FindNext 组合找目录的代码嘛function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;path 可以是 c:\*.*, 这样的东东
    Attr 是 Windows 定义的一些组合, 有以下, 不说也明了吧
    faReadOnly Read-only files
    faHidden Hidden files
    faSysFile System files
    faVolumeID Volume ID files
    faDirectory Directory files
    faArchive Archive files
    faAnyFile Any fileFindFirst & FindNext 返回的结果是 0 是找到了文件, 其它就是错误码