欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

Delphi

當前位置:主頁 > 軟件編程 > Delphi >

Delphi 根據(jù)字符串找到函數(shù)并執(zhí)行的實例

來源:本站原創(chuàng)|時間:2020-01-10|欄目:Delphi|點擊: 次

Delphi 根據(jù)字符串找到函數(shù)并執(zhí)行的實例

 關(guān)鍵字:MethodAddress:取得方法的地址,這個方法需要是published的。

實例代碼:

unit Unit1; 
 
interface 
 
uses 
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
 Dialogs, StdCtrls; 
 
type 
 
 TShowInfo = procedure(info:string) of object;  //聲明一個procedure類型,參數(shù)和ShowInfo一致 
 
 TForm1 = class(TForm) 
  Button1: TButton; 
  procedure Button1Click(Sender: TObject); 
 private 
  { Private declarations } 
 public 
  { Public declarations } 
 
 published 
  procedure ShowInfo(info:string); 
 end; 
 
var 
 Form1: TForm1; 
 
implementation 
 
{$R *.dfm} 
 
{ TForm1 } 
 
procedure TForm1.ShowInfo(info: string); 
begin 
 ShowMessage(info); 
end; 
 
procedure TForm1.Button1Click(Sender: TObject); 
var 
 s:TShowInfo; 
begin 
 @s := MethodAddress('ShowInfo');    //取得ShowInfo的地址 
 if @s <> nil then           //如果不為空 
 begin 
  s('中華人民共和國');         //執(zhí)行 
 end; 
end; 
 
end. 

如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

上一篇:Delphi 常見文件處理及注冊表文件的使用實例

欄    目:Delphi

下一篇:Windows API GetLastError()函數(shù)返回值含義解釋

本文標題:Delphi 根據(jù)字符串找到函數(shù)并執(zhí)行的實例

本文地址:http://mengdiqiu.com.cn/a1/Delphi/8597.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有