|
-
Jul 4th, 2005, 07:47 AM
#1
Thread Starter
Supreme User
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
Last edited by Madboy; Jul 4th, 2005 at 08:11 AM.
-
Jul 4th, 2005, 08:01 AM
#2
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;
I don't live here any more.
-
Jul 4th, 2005, 08:02 AM
#3
Re: Stupid Nested Delphi Statements.....
Please post your delphi questions in the Cubase Forum
-
Jul 4th, 2005, 08:06 AM
#4
Thread Starter
Supreme User
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
-
Jul 4th, 2005, 08:10 AM
#5
Thread Starter
Supreme User
Re: Stupid Nested Delphi Statements.....
Got you, you little worm 
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;
-
Jul 4th, 2005, 09:15 AM
#6
Re: Stupid Nested Delphi Statements.....[RESOLVED]
Has anyone seen Delphi.net yet?
-
Jul 4th, 2005, 11:58 AM
#7
Thread Starter
Supreme User
Re: Stupid Nested Delphi Statements.....[RESOLVED]
I tested Delphi 2005.NET is that what you mean?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|