Delphi 过程类型

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons;

type
  TForm1 = class(TForm)
    SpeedButton1: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
Type
  TMax=Function (a,b:integer):integer;
Function twoMax(a,b:integer):integer;
 begin
   Result:=a+b;
 end;
Function MaxTwo(i,y:integer;Tom:TMax):integer;
 begin
   Result:=tom(i,y);
 end;
procedure TForm1.SpeedButton1Click(Sender: TObject);

begin
  ShowMessage(INTTOSTR(twomax(10,15))+'='+INTTOSTR(MaxTwo(10,15,twomax)));
end;

end.

posted @ 2013-10-29 16:44  似水@流年  阅读(239)  评论(0编辑  收藏  举报
悠悠记得当天笑 仿佛入迷 又带一点惘 种种喜悦 令人为你鼓掌 眉飞色舞千千样 你是个妙人 是个少年狂