Hello, I have a problem with the while function, I tell it a simple calculation, as long as the difference is greater than or equal to 0,
My problem is that the program runs and nothing happens, when I disable the while, the program terminates very quickly, do you think my steps are incorrect
Notice you never again Set Value difference, so the value of difference always stays the same (that Set Value is before the While loop, so it doesn’t repeat like whatever is inside the While)
The While loop runs infinitely because you never update the variable difference
Also note you may need to use the “Global” property of the Set Value
Add another Set Value difference (Global name of the initial Set Value difference) step after the Set Value incrementJour step in the while loop. This will update the value of difference when each loop has finished running all the API actions, and exit the loop when the difference within the loop is calculated as >= 0. Otherwise it will run infinitely as mentioned by Apple.