Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

How to pass arguments to TTask?

$
0
0

If I use TTask from System.Threading. What is the best practise to pass arguments to my "work procedure"? Lets say I want simulate something like the parallel-for.

 

for i := 0 to 10 do ... 

...

  TTask.Create (procedure ()

    begin  

      // How would i get the CURRENT i here?      


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>