Skip to content

WaitProcess

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

WaitProcess BlitzLLVM

WaitProcess:Int32 process:Int32, timeout:Int32=-1
Parameter Mode Type Default Description
process In Int32 required The stream that CreateProcess returned.
timeout In Int32 -1 How long to wait at most, in milliseconds. 0 doesn't wait, -1 waits as long as it takes. Defaults to -1.

Returns: 1 if the program has ended, 0 if it still runs when the time is up.

Description

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

Waits until a program started with CreateProcess has ended, or until the time is up. This is a BlitzLLVM extension: the originals can't wait for the program once it is started.

  • The program does not draw or answer events while it waits, so keep the timeout short in a game loop, or use ProcessRunning, which never waits.
  • A program that writes more than the pipe holds (a few kilobytes) without being read stops until it is read, and then never ends while it is waited for. Read what it writes, or wait with a timeout and read in between.

Examples

process = CreateProcess("tool --convert level.dat")
If WaitProcess(process, 10000)
	Print "Done with exit code " + ProcessExitCode(process)
Else
	KillProcess process
	Print "The tool took too long."
EndIf
CloseFile process

Related Commands

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

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally