type
  TForm1 = class(TForm)    EInvalidation = class(Exception)(这里提示:Expected';'but = found.)
    public
      ErrorCode: Integer;
      constructor Create(Const Msg: String; ErrorNum: Integer);
    end;    EInvalidPassWord = class(EInvalidation)
    public
      constructor Create;
    end;    EInvalidInput = class(EInvalidation)
    public
      constructor Create(ErrorNum: Integer)
    end;
      
    PassWord: TEdit;
    InputEdit: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure InputEditKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;到底哪里出问题了阿?

解决方案 »

  1.   

    把这些异常定义放到FORM定义的外面去
      

  2.   

    可以说的具体点吗?
    具体放哪里啊?
    我这个定义放在unit1里面的
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ComCtrls, DB, DBTables, StdCtrls, ADODB, Grids, DBGrids, Mask;type
      EInvalidation = class(Exception)    <---------- 放这里吧
      public
        ErrorCode: Integer;
        constructor Create(Const Msg: String; ErrorNum: Integer);
      end;
     
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      ...implementation
      .....
      .....