// To understand this, use the callback function {define method type} type tfuntype = function (X: integer): integer; {function type} tproctype = procedure (Name: string); {process type} {define a function that meets the tfuntype} function myfun (X: integer): integer; begin result: = x * 2; end; {define a process that complies with the tproctype type} procedure myproc (Name: string); begin showmessage ('I am' + name); end; {use} procedure tform1.button1click (Sender: tobject); var fun: tfuntype; {defines a tfuntype variable} proc: tproctype; {defines a tproctype variable} begin fun: = myfun; {Let the variable fun point to the custom function myfun} proc: = myproc that has the same parameters and return values as it; {Let the variable proc point to the custom process myproc} with the same parameters {now the variables fun and proc can use} showmessage (inttostr (fun (4) of the two methods ))); {8} proc ('case'); {I am in case} end;