Link to home
Start Free TrialLog in
Avatar of Elvis1
Elvis1

asked on

how to open every file with the name 'README'

Hi everybody, i  would like to write a program which allows to open every file with the 'Readme' name, don't matter which extension, in VB it would be something like

README.*

but in pascal, assuming i have a text file with the full name of 'README.TXT' and if i want to open it I can NOT do like this
assign(F, 'README')
pascal spits an error 'file not found'

can someone help me out of this ???

thanks to everyone in advance
Elvis
Avatar of MrT-RSI
MrT-RSI

FindFirst(readme.*,AnyFile,sr);        //find all files matching readme.*; var sr : SearchRec
while DosError = 0 do begin
  Assign(F,sr.Name);                      //open file found in searchrec
  //do something with file
  Close(F);
  FindNext(sr);
end;
ASKER CERTIFIED SOLUTION
Avatar of MrT-RSI
MrT-RSI

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial