In the third line, which is the Process script block of the For Each-Object cmdlet, the cmdlet searches the message property of each incoming object for "bios".
Another approach is to use actual minimum and maximum values from a list of tasks you're performing.
Even this kind of shared variable (one writer, one reader) can cause problems if not accessed atomically so again we are using TInterlocked to update and to read the variable.
The ‘2.c’ example below shows a simpler way of accessing such shared variable – a TGp4Aligned Int record.
I’ve also put together a demo project which demonstrates all techniques.
First idea is to send a windows message with a ‘percent of processed items’ as a parameter to the main form and let it update itself.
This command displays the progress of a For loop that counts from 1 to 100.