02-14-2020 11:30 AM
For the benefit of current or future readers (and writers), I'd also point out that the use of Local Variables to "set the algorithm apart" (translated online) is not a wise choice in general.
With local variables it is important to ensure the execution order relative to other reads and writes, and in the given code (as altenbach's posts explained) there are several potentially problematic race conditions.
Malkheir, if the use of the "highlight execution" changes the behaviour of your code (or almost any non-time based code) this is a clear indication of a race condition. I make the exception regarding timing because in even valid code, highlight execution has the potential to cause problems there... Apologies that this is not a clear guideline...
02-14-2020 11:39 AM
If we eliminate the race condition, x=y and the code reduces to this (fully tested!):
😄
02-14-2020 12:39 PM
I concur.
Also, do *not* use the code on the left!