01-26-2023 01:01 PM
Hello dear all,
Solved! Go to Solution.
01-26-2023 03:17 PM
There are two ways to do what you want- the "quick and dirty" way and the "right" way.
The quick and dirty way to do it would be to disable the Next button with an Enabled property node (right click->create Property Node). Each time in your loop, check to see if Answer has changed. If it has, enable Next until it's clicked again. That lets you keep the "general" flow of your program, but I wouldn't recommend it as it will be harder to do that in the long run than updating it to the right way.
The right way to do it is to use what's called an Event Structure. Use Help -> Find Examples to see some good examples of how to use them.
Basically, you want to respond to an Event- that is, a user clicking something. An Event Structure lets you do that. It will also get rid of the fact that your current loop spins as fast as possible (a "greedy loop") which isn't good. At the very least, you should add a "Wait" function of 50 or 100 ms in there.
An Event Structure will change your whole program to be event driven and you won't be free-wheeling the loop.
Also, I'd recommend not using a ring or enum for your index. Just use a regular number.
01-26-2023 03:26 PM - edited 01-27-2023 09:57 AM
You could initialize your array with a sentinel value that is not a valid answer (e.g. -1) and only enable "next" if the value is non-negative.
01-27-2023 07:54 AM
Hi @altenbach,
Thank you very much 🙂
Have a nice weekend
01-27-2023 07:55 AM
Hi BertMcMahan,
Thank you also