Solved

how to open every file with the name 'README'

Posted on 2004-04-01
2
194 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 50 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to delete from listbox using edit box 6 297
Unsigned int64 to unsigned int32 10 1,675
ADO Memory leak with DELPHI 2007 37 181
Newbie Thread Programming 1 151
When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
Data breaches are on the rise, and companies are preparing by boosting their cybersecurity budgets. According to the Cybersecurity Market Report (http://www.cybersecurityventures.com/cybersecurity-market-report), worldwide spending on cybersecurity …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 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