很简单的Delphi程序,可是不能运行,不知道错在哪里了

来源:百度知道 编辑:UC知道 时间:2024/05/10 04:44:48
这是一个测试弹出对话框的小程序,用到了这个函数“function MessageDlg(const Msg: string; DlgType: TMsgDlgType;Buttons: MsgDlgButtons; HelpCtx: Longint): Integer;”可是在编译的时候却不能运行,Delphi报错: ':=' expected but '=' found。不知道该怎么改,麻烦大家看看:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
if MessageDlg('你要离开系统吗?',mtconfirmation,[mbYes,mbNo],0)=mrYes then
begin
MessageDlg('系统关闭中',mtInformation,[mbOK],0)=mrOK then
Close;
end;

end.

procedure TForm1.Button1Click(Sender: TObject);
begin
if MessageDlg('你要离开系统吗?',mtconfirmation,[mbYes,mbNo],0)=mrYes then
begin
if MessageDlg('系统关闭中',mtInformation,[mbOK],0)=mrOK then
Close;
end;
end;
掉了一个if和end;
还有已经给了提示了':=' expected but '=' found
期望是:=,但是找到的是=

对!