?
Solved

Directories routine

Posted on 2003-02-28
2
Medium Priority
?
147 Views
Last Modified: 2010-04-04
Hello
Well, i need something like this:
   Theres a TCheckListBox in the Form, with many directories. Like:
      c:\meus documentos
      \\server\sys\docs
      c:\etc\etc\etc
   And one Memo with some directories. One in eatch line.
   Now i need to list in a ListBox all the directoris and subdirectories (recurive). I just dont want to list the directories written in the Memo. But in the fastest way. Can someone do it for me ? i am having big problems with other things and wont have time to do. Thank you.
0
Comment
Question by:BrunoMS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 3

Expert Comment

by:ILE
ID: 8045615
i answer the simular question yestersday
0
 
LVL 3

Accepted Solution

by:
ILE earned 580 total points
ID: 8045652
this is working solution if i andestand what u wont



procedure TForm1.BitBtn1Click(Sender: TObject);
var s:string;
    i,j:integer;
    fl:boolean;
begin
 listbox1.items.clear;
 for i:=0 to checklistbox1.count-1 do
begin
  s:=checklistbox1.items[i]; fl:=false;
  for j:=0 to memo1.lines.count-1;
   fl:= s=memo1.lines[j] or fl
 if fl then  getalldir(s);
end;
end;


procedure tform1.getalldir(s:string);
var rec :tsearchrec;
begin
if sysutils.findfirst(s + '*.*', faAnyFile, Rec)=0 then
begin
  repeat
    if (rec.name<>'.') and (rec.name<>'..') then
    begin
     listbox1.items.Add(s+Rec.Name);
     if rec.attr=fadirectory then getalldir(s+rec.name+'\');
    end;
  until SysUtils.FindNext(Rec) <> 0;
 sysutils.FindClose(rec);
end;


simular question in  
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 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