system.exit¶
since 1.1.0
Exit the current script.
Parameters¶
None.
Returns¶
Nothing.
Examples¶
-- close a system tool from a button
form.addButton(line, nil, { text = "Done", press = function() system.exit() end })
In a widget's configure form, system.exit() leaves the configuration page, as FrSky's gauge example does with an Exit configuration button.
Used in¶
Real-world usage¶
Called 8 times across 5 open-source Ethos Lua projects. A few short excerpts:
local function goBack()
if menuGuard and menuGuard.close then menuGuard.close() end
local hadFrame, parentScreen = nav.pop()
if not hadFrame then
system.exit()
return
end
openScreen(nav, menus, rootEntries, parentScreen, setEventHandler, setWakeupHandler, setPaintHandler, setCleanupHandler, taskGuard)
end