Skip to content
Josh Goebel edited this page Jan 27, 2021 · 21 revisions

exit

exit

Interrupts program execution and returns to the console after the TIC function finishes. Again, to be clear, the entire TIC function is still executed - including potentially any code that follows exit(). See the example below for a demo 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