这是小雨田子第N次给大家送分了,请进吧!!! 在Unit2单元中怎么定义shape类呀 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 TMyShape = class(TShape) 嘻嘻,上边说了;Type//在这儿写,嘻嘻你的新类 = Class(TShape);//俺没有接过你的分,嘻嘻 关键是这个新类中的方法怎么定义呀,我以前是学JAVA的,现在非得让我用DELPHI做,我也很喜欢DELPHI,可以是新手,还得请大家多指教呀,然后在unit1单元怎么使用这些方法呀!!! 嘻嘻,方法,你随便看一看那些源码就知道啦,而且,要放在Public里边;在Unit1里Uses Unit2;嘻嘻 unit unit2;interface TDescendant = class(TAncestor) public //class methods declaration goes here end;unit unit1;implementation uses unit2;var Descendant := TDescendant; unit unit2;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls;type TDescendant = class(TAncestor) // public //class methods declaration goes here end;implementation{$R *.DFM}end.//编译上述代码是出现错误如下是什么意思//[Error] Unit2.pas(8): Undeclared identifier: 'TAncestor'//[Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit2.pas' TAncestor没有定义,如果你定义了,那就是还没注册 TAncestor是从那继承来的啊?你当前是在Unit中定义一个类啊! uses unit2你说很多人认识你,我怎么不认识你啊?自我介绍一下吧。 Delphi 创建三层问题 delphi delphi中如何删除文本中一行 但不留空行 excel的空值导入sql 散分 DCOM的一些困惑,请专家指引 请问一个dbgrid问题,谢谢! rad studio 2010 安装ICS ADO问题,怎样解决? 请问哪里有最新的Delphi控件,书籍下载? 来看看 我在FORM1上加上了数据模块,FROM1上有一个DBedit控件,为什么Datasure属性里却没有
Type//在这儿写,嘻嘻
你的新类 = Class(TShape);
//俺没有接过你的分,嘻嘻
在Unit1里
Uses
Unit2;
嘻嘻
interface
TDescendant = class(TAncestor)
public
//class methods declaration goes here
end;unit unit1;
implementation
uses unit2;
var
Descendant := TDescendant;
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
TDescendant = class(TAncestor)
// public
//class methods declaration goes here
end;
implementation{$R *.DFM}end.
//编译上述代码是出现错误如下是什么意思
//[Error] Unit2.pas(8): Undeclared identifier: 'TAncestor'
//[Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit2.pas'
你说很多人认识你,我怎么不认识你啊?自我介绍一下吧。