procedure TForm1.BitBtn1Click(Sender: TObject);
begin
 begin
  if MessageDlg('Welcome to my Delphi application.  Exit now?',
 mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes;
 then
 begin
    MessageDlg('Exiting the Delphi application.', mtInformation,
      [mbOk], 0, mbOk);
    Close;
  end;
end;end.

解决方案 »

  1.   

    MessageDlg('Welcome to my Delphi application.  Exit now?',
     mtConfirmation, [mbYes, mbNo], 0,mbok)=mryes ;<-要这个“;“干什么
      

  2.   

    procedure TForm1.BitBtn1Click(Sender: TObject);
    begin
     begin
      if MessageDlg('Welcome to my Delphi application.  Exit now?',
     mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes//多了分号;
     then
     begin
        MessageDlg('Exiting the Delphi application.', mtInformation,
          [mbOk], 0, mbOk);
        Close;
      end;
    end;end.
      

  3.   

    procedure TForm1.BitBtn1Click(Sender: TObject);
     begin
      if MessageDlg('Welcome to my Delphi application.  Exit now?',
     mtConfirmation, [mbYes, mbNo], 0) = mrYes
     then
     begin
        MessageDlg('Exiting the Delphi application.', mtInformation,
          [mbOk], 0);
        Close;
      end;
    end;
      

  4.   

    begin 这个没有end
       begin
           begin        end;
       end;