</head> <body> <h1>ExitApp</h1> <p>Terminates the script.</p> <pre class="Syntax"><span class="func">ExitApp</span> <span class="optional">, ExitCode</span></pre> <h2 id="Parameters">Parâmetros</h2> <dl> <dt>ExitCode</dt> <dd><p>An integer between -2147483648 and 2147483647 (or <span class="ver">[in v1.0.48.01+]</span> an <a href="../Variables.htm#Expressions">expression</a>) 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, <em>ExitCode</em> defaults to zero. Zero is traditionally used to indicate success.</p></dd> </dl> <h2 id="Remarks">Remarks</h2> <p>This is equivalent to choosing "Exit" from the script's tray menu or main menu.</p> <p>Any <a href="OnExit.htm">OnExit</a> function or subroutine which has been registered by the script will be called automatically, and may prevent the script from terminating. In such a case, the current <a href="../misc/Threads.htm">thread</a> exits as if <a href="Exit.htm">Exit</a> was called.</p> <p>Terminating the script is not the same as exiting each thread. For instance, <a href="Finally.htm">Finally</a> blocks are not executed and <a href="../Objects.htm#Custom_NewDelete">__Delete</a> is not called for objects contained by local variables.</p> <h2 id="Related">Tópicos relacionados</h2> <p><a href="Exit.htm">Exit</a>, <a href="OnExit.htm#function">OnExit()</a>, <a href="OnExit.htm#command">OnExit</a>, <a href="_Persistent.htm">#Persistent</a></p> <h2 id="Examples">Exemplos</h2> <div class="ex" id="ExHotkey"> <p><a class="ex_number" href="#ExHotkey"></a> Press a hotkey to terminate the script.</p> <pre>#x::ExitApp <em>; Win+X</em></pre> </div> </body> </html>