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

Exit LUA script from a function

  • 1 Replies
  • 8389 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

  • ******
  • 14118
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


SimplePortal 2.3.6 © 2008-2014, SimplePortal