[Lazarus] local procedure - MultiThreadProc

Mattias Gärtner nc-gaertnma at netcologne.de
Wed Aug 19 13:30:11 CEST 2009


Zitat von Jan Kowalski <bor400 at gmail.com>:

> I need to call ProcThreadPool.DoParallel with "local" procedure as a  
> parameter.
> Does DoParallel allow local procedures to pass a procedural parameters ?
> I get err: Error:
> Incompatible type for arg no. 1: Got "<address of local
> procedure(Int64,Pointer,TMultiThreadProcItem);Register>", expected
> "<procedure variable type of
> procedure(Int64,Pointer,TMultiThreadProcItem);Register>"

That would be really helpful.
But I don't know how to define a local procedure type:

type
   TMTLocalProcedure = procedure(Index: PtrInt; Data: Pointer;
                                 Item: Pointer); ?
var
   p: TMTLocalProcedure;

procedure TestWithLocalProc;

   procedure LocalProc(Index: PtrInt; Data: Pointer; Item:  
TMultiThreadProcItem);
   begin

   end;

begin
   p:=@LocalProc;
end;


Mattias






More information about the Lazarus mailing list