Stupid Nested Delphi Statements.....[RESOLVED]
Im in a muddle here, its simple, but frustrating at the best of times. Can anyone see by looking at it any misplaced statements?
EDIT: The problem is the ShowMessage('TEST') is not been called
Code:
procedure TfrmMain.mnuFileOpenClick(Sender: TObject);
var
MsgText, MsgCaption: String;
NL: String;
MsgType, UserResp: integer;
begin
if dlgOpen.Execute then
if dlgOpen.FilterIndex = 1 {Text Document} then
if Dirty1 = True then
begin
NL := #13 + #10; {New Lin}
MsgCaption := 'Super Editor Professional';
MsgText := MsgText + 'The document has changed, if you open a file the changes will be lost.' + NL;
MsgText := MsgText + '' + NL;
MsgText := MsgText + 'Are you sure you want to open a file?';
MsgType := MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON1 + MB_APPLMODAL;
UserResp := MessageBox( Handle, PChar(MsgText), PChar(MsgCaption), MsgType);
Case UserResp of
IDCANCEL:
begin
self.Refresh;
end;
IDYES:
begin
OpenTextFile;
end;
IDNO:
begin
self.Refresh;
end;
else
ShowMessage('Test');
end;
end;
end;
Thanks :afrog:
Re: Stupid Nested Delphi Statements.....
what about
Code:
procedure TfrmMain.mnuFileOpenClick(Sender: TObject);
var
MsgText, MsgCaption: String;
NL: String;
MsgType, UserResp: integer;
begin
if dlgOpen.Execute then
if dlgOpen.FilterIndex = 1 {Text Document} then
if Dirty1 = True then
begin
NL := #13 + #10; {New Lin}
MsgCaption := 'Super Editor Professional';
MsgText := MsgText + 'The document has changed, if you open a file the changes will be lost.' + NL;
MsgText := MsgText + '' + NL;
MsgText := MsgText + 'Are you sure you want to open a file?';
MsgType := MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON1 + MB_APPLMODAL;
UserResp := MessageBox( Handle, PChar(MsgText), PChar(MsgCaption), MsgType);
Case UserResp of
IDCANCEL:
begin
self.Refresh;
end;
IDYES:
begin
OpenTextFile;
end;
IDNO:
begin
self.Refresh;
end;
end;
else
begin;
ShowMessage('Test');
end;
end;
end;
Re: Stupid Nested Delphi Statements.....
Please post your delphi questions in the Cubase Forum :lol:
Re: Stupid Nested Delphi Statements.....
no change, i might try and simplify the code in a seperate procedure then try and call it maybe, keep the nested statements cleaner. Its so SIMPLE, yet easy to get mixed up :lol:
Re: Stupid Nested Delphi Statements.....
Got you, you little worm :cool:
Code:
if dlgOpen.FilterIndex = 1 {Text Document} then
begin
if Dirty1 = False then
OpenTextFile
else if Dirty1 = True then
begin
NL := #13 + #10;
MsgCaption := 'Super Editor Professional';
MsgText := MsgText + 'The document has changed, if you open a file the changes will be lost.' + NL;
MsgText := MsgText + '' + NL;
MsgText := MsgText + 'Are you sure you want to open this file?';
MsgType := MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON1 + MB_APPLMODAL;
UserResp := MessageBox( Handle, PChar(MsgText), PChar(MsgCaption), MsgType);
Case UserResp of
IDCANCEL:
begin
self.Refresh;
end;
IDYES:
begin
OpenTextFile;
end;
IDNO:
begin
self.Refresh
end
end;
end;
Re: Stupid Nested Delphi Statements.....[RESOLVED]
Has anyone seen Delphi.net yet?
Re: Stupid Nested Delphi Statements.....[RESOLVED]
I tested Delphi 2005.NET is that what you mean?