Records of records and procedures are in order. The error message indicates that you are using a local procedure that is defined inside the scope of another function. You cannot use pointers to such functions because they require additional work to call, which cannot be expressed in a regular function pointer. (The compiler forbids creating pointers to functions that the caller does not know how to use.)
The solution is to move your function outside of any other function in which you defined it. If this is difficult to do because the inner function uses variables from the outer function, then you will have to figure out another way to get their values ββto another function, for example, passing them as parameters, possibly making them additional members of this query record.
Another option is to use a reference to the procedure, and then instead define the local procedure as anonymous. It can access local variables, although only Delphi and C ++ Builder will know how to call it, so it is not an option if you need external API compatibility.
source share