L
lmxeq5
Unregistered / Unconfirmed
GUEST, unregistred user!
我在某一个单元里依次声明了这两个类,程序中需要实现它们的相互引用,
主要表现在TNode的属性FChilds:TNodes和TNodes的属性FItems:array[0..MaxNodesSize] of TNode;
但是TNode的属性FChilds:TNodes编译不能通过(因为在此之前没有声明TNodes),有人能告诉我实现
相似的功能应该怎么作吗?不胜感激!!!
{TNode}
TNode=class (TWord)
private
FPart:string;
FMode:WideString;
FAttribule:string;
FTranslateOrder:integer;
FExplain:WideString;
FChilds:TNodes;
FParent:TNode;
procedure SetPart(Value:string);
procedure SetTranslateOrder(Value:integer);
procedure SetMode(Value:WideString);
procedure SetAttribule(Value:string);
function GetAttribule:string;
procedure SetExplain(Value:WideString);
function GetCenterWord:TWord;
procedure SetCenterWord(Value:TWord);
procedure SetChilds(Value:TNodes);
function GetLevel:integer;
public
constructor Create();
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure AddChild(Value: TNode);
procedure Init;
property Part: string read FPart write SetPart;
property Level: integer read GetLevel;
property Mode: WideString read FMode write SetMode;
property Attribule: string read GetAttribule write SetAttribule;
property TranslateOrder: integer read FTranslateOrder write SetTranslateOrder;
property Explain: WideString read FExplain write SetExplain;
property CenterWord: TWord read GetCenterWord write SetCenterWord;
property Childs: TNodes read FChilds write SetChilds;
property Parent: TNode read FParent;
end;
{TNodes}
TNodes=class (TPersistent)
private
FCount:Integer;
FParent:TNode;
FItems:array[0..MaxNodesSize] of TNode;
function GetItem(Index:integer):TNode;
procedure SetItem(Index:integer;Value:TNode);
function GetExplain:Widestring;
public
constructor Create;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
function ArrayCopy(Start,Length:integer):TNodes;
procedure Add(Value: TNode);
property Parent: TNode read FParent;
end;
主要表现在TNode的属性FChilds:TNodes和TNodes的属性FItems:array[0..MaxNodesSize] of TNode;
但是TNode的属性FChilds:TNodes编译不能通过(因为在此之前没有声明TNodes),有人能告诉我实现
相似的功能应该怎么作吗?不胜感激!!!
{TNode}
TNode=class (TWord)
private
FPart:string;
FMode:WideString;
FAttribule:string;
FTranslateOrder:integer;
FExplain:WideString;
FChilds:TNodes;
FParent:TNode;
procedure SetPart(Value:string);
procedure SetTranslateOrder(Value:integer);
procedure SetMode(Value:WideString);
procedure SetAttribule(Value:string);
function GetAttribule:string;
procedure SetExplain(Value:WideString);
function GetCenterWord:TWord;
procedure SetCenterWord(Value:TWord);
procedure SetChilds(Value:TNodes);
function GetLevel:integer;
public
constructor Create();
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
procedure AddChild(Value: TNode);
procedure Init;
property Part: string read FPart write SetPart;
property Level: integer read GetLevel;
property Mode: WideString read FMode write SetMode;
property Attribule: string read GetAttribule write SetAttribule;
property TranslateOrder: integer read FTranslateOrder write SetTranslateOrder;
property Explain: WideString read FExplain write SetExplain;
property CenterWord: TWord read GetCenterWord write SetCenterWord;
property Childs: TNodes read FChilds write SetChilds;
property Parent: TNode read FParent;
end;
{TNodes}
TNodes=class (TPersistent)
private
FCount:Integer;
FParent:TNode;
FItems:array[0..MaxNodesSize] of TNode;
function GetItem(Index:integer):TNode;
procedure SetItem(Index:integer;Value:TNode);
function GetExplain:Widestring;
public
constructor Create;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
function ArrayCopy(Start,Length:integer):TNodes;
procedure Add(Value: TNode);
property Parent: TNode read FParent;
end;