In order to set a value in one function (setup) and use it in another function (loop), the value needs to have global scope. Move the declaration and initial valuation before setup. Then, in setup, see if the button is being pressed, and change the value of the variable if it is.
Don't you just hate it when the original poster pulls the original question.
It's like those problem pages in the magazines that only print the answers. My favourite was something from comedy show Round the Horn from the 60's.
Answer:-
Dear worried from Hownslow, Many men develop strange habits in old age, but until then you will have to wait. Next time he does it I suggest you get the lid on quickly and that will stop the sugar getting all over the place.
Don't you just hate it when the original poster pulls the original question.
Yes, I do. I'd like to see the ability to delete a post, other than the last one in a thread, removed.
If you post a reply, and someone else posts nearly the same thing, a few seconds before, then it should be OK to delete your reply.
If you post something, and someone else posts after you, then the post/reply should be permanent, unless a moderator deletes it.
This was my bad. I meant to modify my original question and ended up deleting it entirely.
Not good, and I apologize.