1-Visitor
April 5, 2022
Question
Using "break" in a function to break a loop or other construct outside the function.
- April 5, 2022
- 1 reply
- 1139 views
Hello. I have a service, it must stop under a certain condition. This condition must contain the "break" construct. I need to make sure that this condition is called literally after every line in the script code. Of course, I did it, but in the end the code turned out to be huge. I tried to shorten it by putting the condition with "break" into the function, and taking the function out of the code. But as I understand it, "break" does not allow it to be used in this way. How it is possible to implement it correctly and beautifully?

