I was looking at the following example in DXE7
http://delphiaball.co.uk/
procedure TFormThreading.Button1Click(Sender: TObject); var aTask: ITask; begin 
// not a thread safe snippet aTask := TTask.Create (procedure () begin sleep 
(3000); // 3 seconds ShowMessage ('Hello'); end); aTask.Start; end;

I dislike this syntax and tried to write it this way because I think it's 
better readable code.
But it's not accepted.

procedure TFormThreading.Button1Click(Sender: TObject); var aTask: ITask; 
procedure MyTask; begin sleep (3000); // 3 secondsShowMessage ('Hello');end

begin // not a thread safe snippet aTask := TTask.Create(MyTask); aTask.Start; 
end;
I just wonder if there is a valuable reason to do it why my example is not 
allowed or would it be easy to make this available in free-pascal?

Thank you.
Sam





________________________________
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to