lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

2013/4/15 Chris Datfung <>:
> I have a script that needs to test for various conditions and based on the
> result of the initial test result it tests for others. For example, based on
> the results of the ChooseSetting(a) function I want to run ChooseSetting(b)
> or skip down to the next test. Using the code below though if Setting1
> equals 5 but Setting2 equals -2 I don't skip down and calculate a value for
> Setting4 (for example). How can I rewrite the if statement to jump out of
> the current block if the Setting* value is less than zero and continue with
> the next test?

Lua 5.2 to the rescue.

   if whatever then goto next_test end
etc etc etc