Posted 30 September 2012 - 03:50 AM
I've almost finished making another game in lua, and all of it works apart from the exiting bit (mainly due to nested loops), so I was wondering if anyone knew of a way to force a program to exit or break out of all loops instead of just the closest one.
I've tried using a repeat until that relies on a boolean value, but since it only tests the value when it reaches the end of the loop, it's not doing what I need at the right time.
It's fine if there isn't a way, I will just have to rearrange the structure, but it would be most handy to know if it does exist. I remember way back when in VB, there was application.exit(), and in XNA there is the ever-popular this.exit(), but as far as I am aware, this feature does not exist in Lua.
I've tried using a repeat until that relies on a boolean value, but since it only tests the value when it reaches the end of the loop, it's not doing what I need at the right time.
It's fine if there isn't a way, I will just have to rearrange the structure, but it would be most handy to know if it does exist. I remember way back when in VB, there was application.exit(), and in XNA there is the ever-popular this.exit(), but as far as I am aware, this feature does not exist in Lua.