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.
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.
mtConfirmation, [mbYes, mbNo], 0,mbok)=mryes ;<-要这个“;“干什么
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.
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;
begin
begin end;
end;