I want to have an app variable count down instead of up. I put the following in the postlude of one rule:
fired {
app:pies -= 1 from 10;
}
The variable app:pies would count from 10 down to 1 but it never reached zero. I need to stop giving out pies when I run out. Why doesn’t the variable ever reach zero? Is there a better way to do this?
It seems that decrementing an app variable won’t ever cause it to go below 1. I have no idea why that is. You can make an app variables be less than 1. This code, for example, starts the variable at -2 and increments it from there, which works fine:
Decrementing just doesn’t seem to work like that…
I would suggest just adjusting the count by 1, such that you pretend that 1 means 0. Your app might look like this in that case: