[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
     NAME: FindFirst

     USE:  Procedure to find the first entry matching the specified
           directory, file name and attributes.  The file attributes
           can be any combination of one or more of the normal DOS
           attributes.  The DOS unit has seven predefined attribute
           constants.  They are

                              const
                                 ReadOnly   = $01;
                                 Hidden     = $02;
                                 SysFile    = $04;
                                 VolumeID   = $08;
                                 Directory  = $10;
                                 Archive    = $20;
                                 AnyFile    = $3F;


           The above constants can be combined together in any way.
           Information is returned through the global record,

                              SearchRec  =  record
                                 Fill:  array(1..2) of byte;
                                 Attr:  byte;
                                 Time:  longint;
                                 Size:  longint;
                                 NAME:  string[12];
                              end;

           Errors are reported through DosError and can obtain any
           valid DOS Error code.



     DEPENDENCY:  The DOS unit must be used placed in the uses section.

     SYNTAX: FindFirst(DirPath : String;AttrByte : Byte;Var DInfo : SaerchRec);

     EXAMPLE:      Program TestFindFile;

                   Uses Dos;
                   Var
                      DInfo : SearchRec;

                   Begin
                      FindFirst('*.*',Archive + Directory,DInfo);
                      While (DosError = ) do
                      Begin
                         Writeln('FileNAME: ',Dirinfo.Name);
                         Writeln('File Attribute: ',DirInfo.Attr);
                         Writeln('File Size: ',DirInfo.Size);
                         Writeln;
                         FindNext(DInfo);
                      end;
                   end.

See Also: FindNext
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson