J
jingandhe
Unregistered / Unconfirmed
GUEST, unregistred user!
unit commonUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,ExtCtrls,Contnrs,INIFILES,DB, ADODB;
type TstatuschangedEvent = procedure (sender:TObject;statustype:Integer;status:boolean) of object; //布尔变量改变事件
type TvaluechangedEvent = procedure (sender:TObject;statustype:Integer;value:Integer) of object; //数字变量改变事件
//设备基类
type
Tdevice=class
private
Fchildtype:Integer; //设备子类别
Fdeviceno:Integer; //设备编号
Fenabled:Boolean; //设备开启使能
public
property childtype:Integer read Fchildtype write Fchildtype;
property deviceno:Integer read Fdeviceno write Fdeviceno;
property enabled:Boolean read Fenabled write Fenabled;
end;
//设备控制柜基类
type
Tdevicetank=class
private
Flist:TList; //控制柜引用列表
Ftankno:Integer; //控制柜编号
Fenabled:Boolean; //控制柜开启使能
public
property list:TList read Flist;
property tankno:Integer read Ftankno write Ftankno;
property enabled:Boolean read Fenabled write Fenabled;
constructor create;
destructor destroy;override;
end;
implementation
{ Tdevicetank }
constructor Tdevicetank.create;
begin
end;
destructor Tdevicetank.destroy;
begin
inherited;
end;
end.
大家帮帮我,我刚刚接触面向对象编程.以上是已经定义好的类的框架,我搞不清楚为什么Tdevice这个类不需要constructor和destructor这个过程,还有Tdevicetank这个类的constructor是不是应该写成给Flist、Ftankno、Fenabled赋值。use下面那两个type 以后怎么引用呢?真是不太懂,请大家帮忙。
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,ExtCtrls,Contnrs,INIFILES,DB, ADODB;
type TstatuschangedEvent = procedure (sender:TObject;statustype:Integer;status:boolean) of object; //布尔变量改变事件
type TvaluechangedEvent = procedure (sender:TObject;statustype:Integer;value:Integer) of object; //数字变量改变事件
//设备基类
type
Tdevice=class
private
Fchildtype:Integer; //设备子类别
Fdeviceno:Integer; //设备编号
Fenabled:Boolean; //设备开启使能
public
property childtype:Integer read Fchildtype write Fchildtype;
property deviceno:Integer read Fdeviceno write Fdeviceno;
property enabled:Boolean read Fenabled write Fenabled;
end;
//设备控制柜基类
type
Tdevicetank=class
private
Flist:TList; //控制柜引用列表
Ftankno:Integer; //控制柜编号
Fenabled:Boolean; //控制柜开启使能
public
property list:TList read Flist;
property tankno:Integer read Ftankno write Ftankno;
property enabled:Boolean read Fenabled write Fenabled;
constructor create;
destructor destroy;override;
end;
implementation
{ Tdevicetank }
constructor Tdevicetank.create;
begin
end;
destructor Tdevicetank.destroy;
begin
inherited;
end;
end.
大家帮帮我,我刚刚接触面向对象编程.以上是已经定义好的类的框架,我搞不清楚为什么Tdevice这个类不需要constructor和destructor这个过程,还有Tdevicetank这个类的constructor是不是应该写成给Flist、Ftankno、Fenabled赋值。use下面那两个type 以后怎么引用呢?真是不太懂,请大家帮忙。