Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
- C
- C#
- Dart
- Erlang
- Fortran
- Go
- Go
- Haskell
- JS
- Java
- Kotlin
- Lua
- PHP
- Pascal
- Pascal
- Perl
- Python
- Ruby
- Rust
- Scala
Environment.Exit(0);
erlang:exit(0).
STOP
defer os.Exit(0)
defer would be used in order to run subsequent deferred statements before exiting
process.exit()
This is only for node.js
System.exit(0);
exit(0);
Halt;
Halt is equivalent to Halt(0), setting the OS exitcode of the program to 0, indicating no error.
Application.Terminate;
exit;
sys.exit(0)
Since exit() ultimately โonlyโ raises an exception, it will only exit the process when called from the main thread, and the exception is not intercepted.
exit
A good article on exit is available at https://www.honeybadger.io/blog/how-to-exit-a-ruby-program/
sys.exit(0)