Procedure FindFirst (const Path: pathstr; Attr: word; var F: SearchRec) ;
FindFirst searches the file specified in Path, checks the atrributes specified in Attr. It returns a SearchRec record for further searching in F.
Path can contain the wildcard characters ? (matches any single character) and * (matches 0 ore more arbitrary characters). In this case FindFirst will return the first file which matches the specified criteria.
If DosError is different from zero, no file(s) matching the criteria was(were) found.
Errors are reported in DosError.
Program Example7; uses Dos; { Program to demonstrate the FindFirst and FindNext function. } var Dir : SearchRec; begin FindFirst('*.*',$20,Dir); WriteLn('FileName'+Space(32),'FileSize':9); while (DosError=0) do begin Writeln(Dir.Name+Space(40-Length(Dir.Name)),Dir.Size:9); FindNext(Dir); end; FindClose(Dir); end.