Skip to content

Tag: counter

How to stop a function when it’s called?

I’m building a program that either counts down or up and I’ve got it working however I like to press count-up in the middle of count down or vice versa and I like the counter to stop and count up or vice versa. how do I achieve that? thanks a lot for your help 🙂 Answer Use a variable to

How to execute this result within a limited function

Questions are as follows: The first time you call the add, it will return 1; the second time you call, it returns 2; Can only be written in function The current idea is that a global variable is needed So the current way of writing But this way of writing does not meet the requirements I don’t know how …

Enable button when counter reaches zero

I have a button its disabled and i want to put a counter inside it, what i want to do is when the counter reaches zero it get enabled, how can i do that? in the code below the counter doesn’t appear inside the button and i don’t want the reset button i just want the button to be enabled