E
eastweast
Unregistered / Unconfirmed
GUEST, unregistred user!
在Delphi7的帮助中看到以下的代码,有些地方不太明白,知道的用比较通俗的语言给解释一下:(代码中的几个赋值有点晕)
原文如下:
----------------------------------------------------------------
You can cast variables to a procedural type. For example, given the declarations
type Func = function(X: Integer): Integer;
var
F: Func;
P: Pointer;
N: Integer;
you can make the following assignments.
F := Func(P)
{ Assign procedural value in P to F }
Func(P) := F
{ Assign procedural value in F to P }
@F := P
{ Assign pointer value in P to F }
P := @F
{ Assign pointer value in F to P }
N := F(N)
{ Call function via F }
N := Func(P)(N)
{ Call function via P }
原文如下:
----------------------------------------------------------------
You can cast variables to a procedural type. For example, given the declarations
type Func = function(X: Integer): Integer;
var
F: Func;
P: Pointer;
N: Integer;
you can make the following assignments.
F := Func(P)
{ Assign procedural value in P to F }
Func(P) := F
{ Assign procedural value in F to P }
@F := P
{ Assign pointer value in P to F }
P := @F
{ Assign pointer value in F to P }
N := F(N)
{ Call function via F }
N := Func(P)(N)
{ Call function via P }