sys.exit([status])

Terminates the program.

Parameters

status

An optionnal number returned to the operating system. Default value is zero. By convention, a value of zero means that the program completed successfully. A value of -1 means that an error occured.

Return value

This function returns no value.

Example

local console = require "console" print('Do you want to terminate the program ? (y/n)') local answer = string.upper(console.read(1)) if answer == 'Y' then sys.exit() end