How do I use a if statement to check if a function is active and set a function to active and inactive?

How do I use a if statement to check if a function is active and set a function to active and inactive?

1 Like

Hi Kelan, Welcome to the Forums.

I did this Timer Tutorial yesterday. I think that using a ā€˜logicā€™ variable in a similar way will help you with this.

1 Like

If its a somewhat simple trigger logic you could try using a switch as a ā€˜if statementā€™ Iā€™ve used this visual logic successfully before. Set the switch to on when the countdown starts, and off when it ends/stopped and then whatever youā€™re trying to trigger you can check if the switch is on or off ie. Found this to be very simple and no need for a verse device for such a simple logic

This is a great tutorial and I was able to get what information I needed. The solution I found was ā€œvar VaribleName : logic = trueā€ and then using ā€œset VaribleName = falseā€ or ā€œset VaribleName = trueā€ throughout my code and using if statements to check if it was true ā€œif (VaribleName?):ā€ Thank you :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.