Page 1 of 1

Break or return Action

PostPosted: Sun 10 Feb 2019, 18:15
by Nicanor
I ran into an issue where I was testing a list of nested sub conditions when the sub condition was true the action played but it continued to run through the list of sub conditions where I would want it to “break” from running the code.

Is there a “break” action?

Re: Break or return Action

PostPosted: Sun 10 Feb 2019, 20:15
by ddabrahim
There is no break action. Sub events are being executed if the conditions of the parent was true. You need to use a variable to break. Have a variable call it Break and then check the value of this variable for each sub event.

If Break = 0 : Do something.

And then if you know that you want to break at this point and you don't want to execute the next sub event, just Do = 1 to Break so the condition (If Break = 0) in the next sub event going to be false and the actions not going to be executed and the rest of the sub events going to be skipped also.
Then set the variable back to 0 again at some point in your program flow so you can use it again.

Re: Break or return Action

PostPosted: Mon 11 Feb 2019, 00:56
by Nicanor
Ah perfect solution! Thank you :D