[fpc-pascal] TThread.Queue vs TThread.Synchronize

Sven Barth pascaldragon at googlemail.com
Mon Feb 23 20:17:09 CET 2015


On 23.02.2015 19:32, silvioprog wrote:
> On Mon, Feb 23, 2015 at 3:23 PM, Sven Barth <pascaldragon at googlemail.com
> <mailto:pascaldragon at googlemail.com>> wrote:
> [...]=== code begin ===
>
>
>     procedure TMyThread.Execute;
>     var
>        s: String;
>
>        procedure SyncOnPrint;
>        begin
>          fOnPrint(s);
>        end;
>
>     begin
>        s := 'Hello World';
>        Queue(@SyncOnPrint);
>     end;
>
>     === code end ===
>
>
> How to compile it?:
>
> Error: Incompatible type for arg no. 1: Got "<address of procedure is
> nested;Register>", expected "<procedure variable type of procedure of
> object;Register>".

Did you even read this part? And especially the tense it's written in?

>
> For FPC modes and those people that dislike the syntax of anonymous functions (and yes, I can understand those people ) I hope that we'll get the following variation to work as well:

Regards,
Sven




More information about the fpc-pascal mailing list