## `quit` -- terminate the MuPAD session

#### Introduction

On the interactive level, the statement `quit` terminates the MuPAD session.

#### Call(s)

quit `_quit()`

#### Related Functions

`break`, `next`, `Pref::callOnExit`, `reset`, `return`

#### Details

- The `quit` statement is equivalent to the call `_quit()`.
- If `quit` is used on the interactive level, it terminates the running MuPAD session and returns to the system level where MuPAD was started.
- `quit` should not be used in a procedure. However, if it is used, only this procedure is terminated. Note that in this case the return value of the procedure is undefined. Use `return` to terminate a procedure.
- When using a non-terminal version of MuPAD such as the MuPAD Pro Notebook, the Apple Macintosh user interfaces or the X11 user interfaces, the corresponding `Quit` button of the MuPAD session window must be used rather than the `quit` statement. In these versions, the `quit` statement leads to an error message.
- When a MuPAD session is terminated, so-called exit handlers are executed before exiting the MuPAD kernel. Exit handlers can be installed via the function `Pref::callOnExit`.
- `_quit` is a function of the system kernel.

#### Example 1

In this example, the Linux/UNIX terminal version of MuPAD is started and then terminated using the `quit` statement:

          myprompt> mupad

             *----*    MuPAD 2.0.0 -- The Open Computer Algebra System
            /|   /|
           *----* |    Copyright (c)  1997 - 2000  by SciFace Software
           | *--|-*                   All rights reserved.
           |/   |/
           *----*      Universität Paderborn, FB-17, Mathematik

          >> quit
          myprompt>

#### Example 2

In a MuPAD version with a graphical user interface, e.g., under Windows 9x/NT/2000, the Apple Macintosh operating system, or Linux/UNIX with X11/Motif, a `quit` command results in the following error message:

    >> quit

          Warning: Quit the kernel via the user interface [quit]

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000