lua-users home
lua-l archive

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


>is there a way to redefine exit() so that instead of exiting the entire program, it returns immediately from that dostring ?

Use error(), with no arguments. Try this:

 print"HELLO"

 dostring[[
  print"hello"
  error()
  print"bye"
 ]]

 print"BYE"

This will print

 HELLO
 hello
 BYE

--lhf