Procedural Type & Method Pointer in Delphi
Procedural Type : Procedural type is one of user defined data type that allows you to consider procedures and functions as values that can be assigned to variables or passed to other procedures and functions. It is mostly used when we call DLL methods in Dynamic call, to declare custom Events for components. The following example demonstrates usage of a procedural type. Suppose you define a function called Calc that takes two integer parameters and returns an integer: function Calc(X,Y: Integer): Integer; You can assign the Calc function to the variable F: var F: function(X,Y: Integer): Integer; F := Calc; How to declare? : If you take any procedure or function heading and remove the identifier after the word procedure or function, then what is left is the right part of a procedural type declaration. You can use such type names directly in variable declarations (as in the previous example) or to declare new types: type TIntegerFunction = function: In...