我有一个数据模块 (TfDB) 我想向它添加这个函数
Function GetZone(zone :string):string;
当我尝试运行它时,我得到了这个错误......外部声明不满意:TfDB.GetZone
unit MyDataModule;
interface
uses
System.SysUtils, System.Classes, Data.DB, Data.Win.ADODB;
type
TfDB = class(TDataModule)
dbconnection: TADOConnection;
private
{ Private declarations }
public
Function GetZone(zone :string):string;
end;
var
fDB: TfDB;
implementation
{%CLASSGROUP 'System.Classes.TPersistent'}
{$R *.dfm}
Function GetZone(zone:string):string;
begin
if zone = 'FLayout1' then
result := '1';
if zone = 'FLayout2' then
result := '2';
if zone = 'FLayout3' then
result := '3';
if zone = 'FLayout4' then
result := '4' ;
if zone = 'FBoneYard' then
result := 'BoneYard';
if zone = 'FShop' then
result := 'shop';
if zone = 'FMisc' then
result := 'Misc' ;
end;
end.