现在的位置: 首页 > 综合 > 正文

匿名方法[1]

2013年12月08日 ⁄ 综合 ⁄ 共 256字 ⁄ 字号 评论关闭
Tfun = REFERENCE to function(c, y: integer): integer;

function Ta(x, y: integer; Tb: Tfun): integer;
begin
  result := Tb(x, y);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(inttostr(Ta(7, 8, function(c, y: integer): integer//引处不能有分号;
                                      begin
                                         result :=x + y;
                                      end)));
end;

抱歉!评论已关闭.