Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to open every file with the name 'README'

Posted on 2004-04-01
2
Medium Priority
?
201 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:Elvis1
  • 2
2 Comments
 
LVL 2

Expert Comment

by:MrT-RSI
ID: 10733403
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;
0
 
LVL 2

Accepted Solution

by:
MrT-RSI earned 200 total points
ID: 10733420
... ofcourse there should be quotes around 'readme.*':

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;

... also: requires DOS unit
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question