Application.Exit

Application.Exit ( 

number ReturnCode = 0 )

Example 1

Application.Exit();

Immediately closes the application.

Example 2

Application.Exit(4);

Immediately exits the application and returns 4 as a custom return code to the calling process.

Example 3

-- Ask the user if they really want to exit
nChoice = Dialog.Message("Confirm Exit", "Are you sure you wish to exit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2);

-- If yes was chosen, exit the application.
if nChoice == 6 then
   Application.Exit();
end

Confirm with the user that they wish to exit. If the choice is confirmed, exit the application, otherwise do nothing.

See also:  Related Actions