大家好!我是Delphi的初学者,今天在看书中有下面登录验证的一个例子,按照书上写着,可是在调试的时候
else if (var1 = 'hym') and (var2 = '8999') then //第46行

else  //第48行提示出错!
谢谢各位帮助!内容附下:unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    edit1: TEdit;
    edit2: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;
  var1:string;
  var2:string;
  var3:string;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
var1:=edit1.Text;
var2:=edit2.Text;if (var1='') and (var2='') then
   ShowMessage('Please input ID & PWD!')
else if(var1<>'') and (var2='') then
   showmessage('Please input PWD!')
else if(var1='') and (var2<>'') then
   showmessage('Please Input ID');
else if (var1 = 'hym') and (var2 = '8999') then
   showmessage('Welcome!');
else
  showmessage('ID & PWD is not correct, Please try again!')
end;procedure TForm1.Button2Click(Sender: TObject);
begin
var1:='';
var2:='';
close;
end;end.