2 |
<head> |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>exit() function</title> |
<title>exit() function</title> |
5 |
<meta name="description" content="Stops execution of the current event handler instance."> |
<meta name="description" content="Returns from current execution block."> |
6 |
</head> |
</head> |
7 |
<body> |
<body> |
8 |
<h1>exit()</h1> |
<h1>exit()</h1> |
9 |
<p> |
<p> |
10 |
Stops execution of the current event handler instance. |
Returns from current execution block. |
11 |
It does <b>not</b> stop execution of other |
</p> |
12 |
|
<p> |
13 |
|
If the <code>exit()</code> function was called from a |
14 |
|
<a href="nksp.html#user_functions">user function</a>, |
15 |
|
that user function is exited and execution continues from where that |
16 |
|
user function was called (e.g. from another user function or an event |
17 |
|
handler). |
18 |
|
</p> |
19 |
|
<p> |
20 |
|
If the <code>exit()</code> function was called <b>directly</b> from an |
21 |
|
event handler, that event handler is exited (i.e. execution of that |
22 |
|
event handler instance is stopped). |
23 |
|
</p> |
24 |
|
<note> |
25 |
|
The function name <code>exit()</code> is a bit misleading. This function |
26 |
|
behaves identical to return statements in other programming languages. |
27 |
|
So calling <code>exit()</code> does <b>not</b> stop execution of other |
28 |
instances of the same event handler, nor does it stop execution of other |
instances of the same event handler, nor does it stop execution of other |
29 |
handlers of other event types, and especially it does <b>not</b> stop or |
handlers of other event types, and especially it does <b>not</b> stop or |
30 |
prevent further or future execution of your entire script! In other words, |
prevent further or future execution of your entire script! |
31 |
you should rather see this function as a return statement, in case you are |
</note> |
32 |
familiar with other programming languages already. |
|
|
</p> |
|
|
|
|
33 |
<h3>Function Prototype</h3> |
<h3>Function Prototype</h3> |
34 |
<p/> |
<p/> |
35 |
<code lang="nksp"> |
<code lang="nksp"> |