04-17-2020 10:40 PM
Hi,
I'm trying to make a make a boolean that shows true if and only if you are in a specific case in a case structure. The problem is the case structure is in a while loop and so the case structure is called multiple times and the boolean will stay true even if the case has switched.
Thanks
04-17-2020 11:10 PM
Code it so that it goes false in any of the other cases. A vague question with no code begets a vague answer with no code, too. GIGO, really.
04-17-2020 11:12 PM
How fast is the loop running? Is it a true/false case structure or one with multiple options?
How often is it in the specific case vs. how often it isn't?
If it is a fast running while loop, you may not be able to see quick enough when the boolean is true vs. false.
If you attached some specific code, we could see more specifically what you are trying to do.
Why do you want to know it is in a specific case?
04-18-2020 02:08 AM
Place the LED before the case structure, connected to the same wire that is going to the case selector.
(If you place the indicator inside the case, it will not update in the other cases unless you do some convoluted code with local variables. Please don't!)
04-20-2020 03:03 AM
@kazisl wrote:
I'm trying to make a make a boolean that shows true if and only if you are in a specific case in a case structure.
I assume you mean you want the Boolean on if the code in a specific case is executing? If it's true only when I am in the specific case, always set it to false. I will never be in it 😁.
I'd set the Boolean true in the specific case, and false in the specific case. Then put everything that takes time between the two.
Another option (mentioned already) is to set the Boolean before the case: true if it will enter the specific case, false if not.
Both will work in specific scenarios only. In other words: it depends... It depends on exactly what you want, and how you build it.