How can I stop a for loop while its in progress? Return stops the whole function, but I only need to stop the loop. I could just set a public variable after to just don't run any code in the future loops, then reset it when the loops finish and it wouldn't support multiple loops, but I'm sure there's a better way. Is there a command like Break() or something like that?
[QUOTE=freemmaann;26560332]How can I stop a for loop while its in progress? Return stops the whole function, but I only need to stop the loop. I could just set a public variable after to just don't run any code in the future loops, then reset it when the loops finish and it wouldn't support multiple loops, but I'm sure there's a better way. Is there a command like Break() or something like that?[/QUOTE]
It's break.
[url]http://www.lua.org/pil/4.4.html[/url]
Thank you. I knew I seen it used somewhere before.
Sorry, you need to Log In to post a reply to this thread.