For example, the following code:
Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, forms,dialogs;
Type
TForm1 = Class (Tform)
Procedure one ();
function (x,y:integer): integer;
Private
{Private declarations}
Public
{Public declarations}
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Procedure Tform1.one ();
Var
P:pointer;
Begin
P:[email protected];
End
function Tform1.two (x,y:integer): integer;
Begin
Result:=x+y;
End
End.
In the Delphi5, there is no problem, to Delphi7, 2007, 2009 will be an error: the need for variables (Delphi6 did not try)
The reason is that the function required to return a function address in the new version must be a global function, so the program should change to this:
................................
Var
Form1:tform1;
function (x,y:integer): integer;
................................
function (x,y:integer): integer; ......
Problem with @ FETCH function address in Delphi (GO)