hallo zusammen!
Ich hab eine frage, Ich habe dieser Prozedure gemacht.
Kann man diese Prozedure besser machen?
Delphi-Quellcode:
procedure TMainForm.Open1Click(Sender: TObject);
begin
if IsModified then
begin
case MessageDlg('Do you want to save the current file?', mtConfirmation,
[mbYes, mbNo, mbCancel], 0) of
mrYes:
begin
Save1Click(Sender);
if SocOpen then Warning2
else begin
OpenDialog1.InitialDir := ExtractFileDir(Application.exename) + '\Sessions\';
OpenDialog1.DefaultExt := 'emu';
if OpenDialog1.Execute then
begin
Save1Click(Sender);
LoadOptions(OpenDialog1.Filename);
CurrentFile := OpenDialog1.FileName;
MakeConnect
end
else begin
OpenDialog1.InitialDir := ExtractFileDir(Application.exename) + '\Sessions\';
OpenDialog1.DefaultExt := 'emu';
if OpenDialog1.Execute then
begin
LoadOptions(OpenDialog1.Filename);
CurrentFile := OpenDialog1.FileName;
MakeConnect;
end;
end;
end;
end;
mrNo:
begin
if SocOpen then Warning2
else begin
OpenDialog1.InitialDir := ExtractFileDir(Application.exename) + '\Sessions\';
OpenDialog1.DefaultExt := 'emu';
if OpenDialog1.Execute then
begin
LoadOptions(OpenDialog1.Filename);
CurrentFile := OpenDialog1.FileName;
MakeConnect;
end;
end;
end;
mrCancel: ;
end;
end
else
if socOpen then Warning2
else begin
OpenDialog1.InitialDir := ExtractFileDir(Application.exename) + '\Sessions\';
OpenDialog1.DefaultExt := 'emu';
if OpenDialog1.Execute then
begin
LoadOptions(OpenDialog1.Filename);
CurrentFile := OpenDialog1.FileName;
MakeConnect;
end;
end;
end;
schon mal großes DANKE im voraus
Gruß
Peter
[edit=SirThornberry]Code-Tags durch Delphi-Tags ersetzt - Mfg, SirThornberry[/edit]