Results 1 to 7 of 7

Thread: Stupid Nested Delphi Statements.....[RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width