Saves the output of the process to a string buffer.
Kernel.bdh
ProcessSetOutputBuffer( in hProc :number, in sBuffer :string, in nBufferLen :number optional, in sLineSeparator :string optional ): boolean;
true if successful.
false in case of an error. The GetLastError function may be used to retrieve the system error code.
Parameter | Description |
---|---|
hProc | The handle that identifies the process. It is returned by the ProcessInitialize function. |
sBuffer | Pointer to the buffer used for writing the process output. |
sBufferLen | Maximum size of the string buffer (optional). |
sLineSeparator | The line separator which is placed between every line in the string buffer. If it is null, nothing is placed between the particular lines (optional). |
dcltrans transaction TMain var hProcessId : number; sBuffer : string(4096); sErrorBuffer : string(2048); begin // Create process and start it up... hProcessId := ProcessInitialize("application1.exe", PROCESS_PIPED, "", "c:\\temp\\", "c:\\temp\\out.txt"); ProcessSetEnv(hProcessId, "temp", "c:\\temp\\"); ProcessSetOutputBuffer(hProcessId, sBuffer, STRING_COMPLETE, ";"); ProcessSetErrorBuffer(hProcessId, sErrorBuffer); ProcessStart(hProcessId); Print("StdOut: " + sBuffer); Print("ErrorOut: " + sErrorBuffer); ProcessFree(hProcessID); end TMain;