unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, FileCtrl,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
FileListBox1: TFileListBox;
ListBox1: TListBox;
ListBox2: TListBox;
SaveDialog1: TSaveDialog;
SelectDirectoryDialog1: TSelectDirectoryDialog;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var i, j: integer;
begin
ListBox2.Clear;
if SelectDirectoryDialog1.Execute and SaveDialog1.Execute
then
begin
FileListBox1.Directory:=SelectDirectoryDialog1.FileName;
FileListBox1.UpdateFileList;
i:=0;
while i< FileListBox1.Items.Count do
begin
ListBox1.Items.LoadFromFile(SelectDirectoryDialog1.FileName+'\'+FileListBox1.Items[i]);
j:=1;
while j< ListBox1.Items.Count-1 do
begin
listBox2.Items.Add(ListBox1.Items[j]);
inc(j);
end;
inc(i);
end;
Listbox2.Items.SaveToFile(SaveDialog1.FileName);
end;
end;
end.