Difference between revisions of "Manual:DIL Manual/quit"
Jump to navigation
Jump to search
(XML import) |
(checked against the compiler and the interpreter; example compiles) |
||
| Line 1: | Line 1: | ||
| − | + | = quit = | |
| − | + | '''Procedure.''' Ends the program for good. | |
| − | |||
| − | |||
| − | + | quit; | |
| − | |||
| − | quit | ||
| − | |||
| − | |||
| − | + | The program stops at once and is removed from its unit. It doesn't run again; a new copy only comes with a new unit (a reset) or a <code>dilcopy</code>. | |
| + | |||
| + | == Notes == | ||
| + | * Inside a procedure or function called as <code>name@zone(...)</code>, <code>quit</code> ends the whole program, the caller included. Use <code>return</code> to leave only the called template. | ||
| + | * Its secures, interrupts and <code>priority</code> end with it. | ||
| + | * A <code>block</code> before <code>quit</code> still blocks the event. | ||
| + | * A program that should run again for the next event goes back to waiting (<code>goto</code> to a label before its <code>wait</code>) instead. | ||
| + | |||
| + | == Example == | ||
| + | <pre> | ||
| + | dilbegin follow_note(); | ||
| + | code | ||
| + | { | ||
| + | if (not self.master) | ||
| + | quit; | ||
| + | |||
| + | act("You now follow $3n.", A_ALWAYS, self, null, self.master, TO_CHAR); | ||
| + | quit; | ||
| + | } | ||
| + | dilend | ||
| + | </pre> | ||
| + | Does its one job and ends; with no one to follow it ends at once. Adapted from basemove.zon. | ||
| + | |||
| + | == See also == | ||
| + | * [[Manual:DIL Manual/return()|return()]] | ||
| + | * [[Manual:DIL Manual/goto|goto]] | ||
| + | * [[Manual:DIL Manual/dilcopy()|dilcopy()]] | ||
Latest revision as of 23:23, 14 November 2026
Contents
quit
Procedure. Ends the program for good.
quit;
The program stops at once and is removed from its unit. It doesn't run again; a new copy only comes with a new unit (a reset) or a dilcopy.
Notes
- Inside a procedure or function called as
name@zone(...),quitends the whole program, the caller included. Usereturnto leave only the called template. - Its secures, interrupts and
priorityend with it. - A
blockbeforequitstill blocks the event. - A program that should run again for the next event goes back to waiting (
gototo a label before itswait) instead.
Example
dilbegin follow_note();
code
{
if (not self.master)
quit;
act("You now follow $3n.", A_ALWAYS, self, null, self.master, TO_CHAR);
quit;
}
dilend
Does its one job and ends; with no one to follow it ends at once. Adapted from basemove.zon.