xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_ProcessValue()

Retrieves the return value of a child process.

Syntax

HB_ProcessValue( <nProcessHandle>, ;
                [<lWaitForTermination>] ) ) --> nErrorLevel

Arguments

<nProcessHandle>
This is the numeric process handle of the child process to retrieve the return code of. It is returned from HB_OpenProcess().
<lWaitForTermination>
This parameter defaults to .T. (true) so that the parent process waits until the child process has regularly ended with program execution. When .F. (false) is passed, the function returns immediately if the child process is still executing its program.

Return

The function obtaines the return code of the program running in the child process. This return code is set via ErrorLevel() when the child process runs an xHarbour application. If the child process has not finished program execution when HB_ProcessValue() returns, the return value is -1.

Description

HB_ProcessValue() can be used for two purposes: it can check if a child process started with HB_OpenProcess() is still executing its program, or it can halt the parent process until the child process is complete with program execution.

To "kill" a program running in a child process, call HB_CloseProcess() and pass .F. (false) as second paremeter.

Info

See also:HB_CloseProcess(), HB_OpenProcess()
Category: Process functions , xHarbour extensions
Source:rtl\philes.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe