t3x.org / t3x / t3x-manual / 3AK.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
3.10.19 TIME
TOC | Index | Back Next:
3.11 TTYCTL -- Video Terminal Control

3.10.20 WAIT

SYS.WAIT(pid) ! => Num

Wait for a subprocess to terminate and return its exit code. 'Pid' contains the process ID of the process to wait for. It must be a PID obtained from SYS.SPAWN or SYS.FORK.

WAIT returns the exit code of the process waited for. The exit code is the value passed to the HALT command of T3X. When the process waited for terminates abnormally, WAIT returns -1. It also returns -1 when an invalid PID is passed to it.

NOTE: WAIT does not actually wait for a specific process to terminate. Therefore, no more than a single subprocess should be active at the same time.

See also: SPAWN, FORK

Previous:
3.10.19 TIME
TOC | Index | Back Next:
3.11 TTYCTL -- Video Terminal Control