成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

delphi語言教程 delphi中接口的定義和使用?

delphi中接口的定義和使用?Define interface idemotypeidemo=interface function a(I:integer):integerend接口中的方法不能有方

delphi中接口的定義和使用?

Define interface idemotypeidemo=interface function a(I:integer):integerend接口中的方法不能有方法體,只能有聲明。然后可以使用接口對象或繼承接口typetdemo=class(tcomponent,IDEO)publicfunctiona(I:integer):integerend,然后構(gòu)造functiontdemo。A(I:integer):integerbeginresult:=I*2end表示類中方法的方法體。也可以將對象轉(zhuǎn)換為接口,例如:變量impl:IDemoTImpl:tDemoBeginTempl:=TDemo.創(chuàng)建(nil)IImpl:=IImpl(TImpl)end

如果您說“Delphi接口標(biāo)志”,它是指接口的唯一標(biāo)識號。方法如下:

1。在delphiide中,按Ctrl-Shift-g鍵為接口生成新的guid。

2. 可以使用函數(shù)createguid生成guid。示例代碼如下:函數(shù)getguid:String var LTEP:tguid begin createguid(LTEP)result:=guidtostring(LTEP)end