Skip to content
paul59 edited this page Jul 25, 2021 · 21 revisions

exit

exit

This function causes program execution to be interrupted after the current TIC function ends. All code in the TIC function for the current frame will be executed - including any code that follows exit(). See the example below for a demo of this behavior.

Once execution is interrupted you are returned to the console.

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