Exit LUA script from a function - LUA Scripting - CHDK Forum supplierdeeply

Exit LUA script from a function

  • 1 Replies
  • 6031 Views
Exit LUA script from a function
« on: 25 / June / 2011, 17:33:21 »
Advertisements
Hi, how do I go about exiting a script from a function? I'm trying to do something like this:

Code: (lua) [Select]
function init()
  if not focus() then
    os.exit(1)
  end
end

But I'm getting an error in "os.exit(1)" since it does not seem to be implemented.

*

Offline reyalp

  • ******
  • 12793
Re: Exit LUA script from a function
« Reply #1 on: 25 / June / 2011, 17:41:45 »
The only way to do this at the moment is to throw an error. This is a bug.

os.exit is supposed to exit the process, but that doesn't really make sense in the CHDK environment.
Don't forget what the H stands for.

 

Related Topics