Skip to content
paul59 edited this page Nov 23, 2021 · 21 revisions

exit

exit

This function causes program execution to be terminated after the current TIC function ends. The entire function is executed, including any code that follows exit(). When the program ends you are returned to the console.

See the example below for a demonstration of this behavior.

Example

Example

-- title:  exit API Command Demo (Lua)
-- author: StinkerB06

function TIC()
  cls(0)
  print("Press Z to exit to console.",1,1)
  if btn(4) then
    exit()
    trace("This code still runs!")
  end
end
Clone this wiki locally