09-12-2011 07:19 AM
well try it with the way questionmarker has given ,
put your whole code (without while loop) inside the boolean - value change event and see.
I can explain it more clearly but i want you to learn and do it yourself.
Happy on discussing........
09-12-2011 08:50 AM
Fixed.
/Y
09-12-2011 09:02 AM
is this what you mean?
09-12-2011 10:11 AM
@ Yamaeda
i think the question is not about doing the things rather what is wrong in the attempt................
please continue the discussion till the person is satisfied.
Thanks.................
09-12-2011 10:26 AM
give him a fish or teach him how to fish...
To answer the question:
"i want different reactions, if boolean true, wait 5 seconds and execute, if false, then reset immediately, whats hard on that ?"
Absolutely nothing is hard on that. The Event Structure clearly is what you want to use; adjust it to your needs. I posted you a functional sample code, all you have to add is a case structure within with and without timer.It will work fine, though its not the best solution (try what happens if the user clicks faster than each 5 sec after you added your delay)
Besides; as you used the words execute and reset, I would reccomend have a look at queued step engines / queued state machine, maybe these design paterns may be useful for you.
I hope you can solve your problem with the hints given in this thread, enjoy!
09-13-2011 05:04 AM
@Questionmarker yes, looks like am little rusty on loops, will try to practice more on that.
09-13-2011 05:06 AM
thank you, @alok.p , will work harder on loops, and thanks more for insisting on doing it on my own.
09-13-2011 05:38 AM
B4S3M,
You are always welcome