unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ShellCtrls, StdCtrls, ExtCtrls;
type
TForm4 = class(TForm)
ShellTreeView1: TShellTreeView;
Button1: TButton;
RadioGroup1: TRadioGroup;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
const
Pfadalt = 'E:\Delphi\Mathematik\Primzahlen Aufgelistet.txt';
var
Form4: TForm4;
sepfad:ttreenode;
f : textfile;
g :textfile;
pfad : string;
vorstr : string;
implementation
uses Mathematik, Unit5, Unit2, Unit3, Unit6;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
begin
sepfad := shelltreeview1.Selected;
pfad:=shelltreeview1.Path+'\'+edit1.text+'.txt';
if fileexists(pfad) then
begin
form5.show;
end
else
begin
if radiobutton2.Checked then
begin
schreibetextfile ;
end;
if radiobutton3.Checked then
begin
copyfile(pansichar(pfadalt),pansichar(pfad),true);
end;
end;
end;
procedure schreibetextfile ;
var i : integer;
begin
assignfile(f,pfad);
assignfile(g,pfadalt);
rewrite(f);
reset(g);
for i := 1 to aerg do
begin
if i=1 then
begin
read(g,vorstr);
showmessage(vorstr);
write(f,vorstr);
end;
end;
end;
procedure TForm4.FormActivate(Sender: TObject);
begin
shelltreeview1.Selected := sepfad;
if radiobutton2.Checked then edit1.Text := 'Primzahlen Text';
if radiobutton3.Checked then edit1.Text := 'Primzahlen List';
end;
procedure TForm4.RadioButton2Click(Sender: TObject);
begin
if (radiobutton2.Checked) and (edit1.Text = 'Primzahlen List') then edit1.Text := 'Primzahlen Text';
if (radiobutton3.Checked) and (edit1.Text = 'Primzahlen Text') then edit1.Text := 'Primzahlen List';
end;
end.