Skip to content

ProcessExitCode

Narta Xaymar Dirks edited this page Dec 3, 2026 · 2 revisions

ProcessExitCode BlitzLLVM

ProcessExitCode:Int32 process:Int32
Parameter Mode Type Default Description
process In Int32 required The stream that CreateProcess returned.

Returns: The exit code of the program, or -1 while it still runs.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

Gives the exit code of a program started with CreateProcess, once it has ended. This is a BlitzLLVM extension: the originals can't ask about the program once it is started.

  • A BlitzLLVM program gives 0 when it ends normally (with End or at the end of its code), and 1 after a RuntimeError.
  • On Linux and macOS a program ended by a signal gives 128 and the number of the signal, as shells do: 143 after KillProcess, 137 after KillProcess with force, 139 after a crash (SIGSEGV). On Windows KillProcess ends the program with 143 or 137 too, so the numbers are the same everywhere, and a crash gives the exception code of Windows, such as -1073741819 ($C0000005).
  • It never waits. Use WaitProcess first to be sure that the program has ended.

Examples

process = CreateProcess("tool --check")
WaitProcess process
If ProcessExitCode(process) <> 0 Then Print "The check failed."
CloseFile process

Related Commands

CreateProcess BlitzPlus, KillProcess BlitzLLVM, ProcessID BlitzLLVM, ProcessRunning BlitzLLVM, ReadProcessStream BlitzLLVM, WaitProcess BlitzLLVM, WriteProcessStream BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally