# ExitApp

Terminates the script unconditionally.

    ExitApp , ExitCode

## Parameters

ExitCode

  An integer between -2147483648 and 2147483647 (or [in v1.0.48.01+] an expression) that is returned to its caller when the script exits. This code is accessible to any program that spawned the script, such as another script (via RunWait) or a batch (.bat) file. If omitted, ExitCode defaults to zero. Zero is traditionally used to indicate success.

## Remarks

The script is immediately terminated unless it has an OnExit subroutine. This is equivalent to choosing "Exit" from the script's tray menu or main menu.

Exit and ExitApp behave identically when the script contains no hotkeys, is not persistent, and does not ask for `NumLock`/`ScrollLock`/`CapsLock` to be kept AlwaysOn or AlwaysOff.

If the script has an OnExit subroutine, it will be run in response to ExitApp.

## Related

Exit, OnExit, #Persistent

## Examples

#1

    #x::ExitApp  ; Assign a hotkey to terminate this script.