Sign in Join
FPDoc Onlineexperiment

TProcess.ReadInputStream function

Member of TProcesspublicIn unit Process

Read available data from input stream.

Declaration

pascal
function ReadInputStream(p: TInputPipeStream; var BytesRead: Integer; 
 var DataLength: Integer; var Data: string; 
 MaxLoops: Integer=10): Boolean; virtual
function ReadInputStream(p: TInputPipeStream; data: TStream; 
 MaxLoops: Integer=10): Boolean; virtual

Arguments

p

Pipe stream to read data from.

BytesRead

Number of bytes read during the call.

DataLength

On entry, length of data. Updated with new length when the call ends.

Data

String data or stream data.

MaxLoops

Number of times to check if data is available.

Function result

True if data was read.

Description

ReadInputStream reads data from the given input pipe stream p after checking that data is available. It returns True if data was succesfully read from the file handle. In the variant with a string data, the data is placed in the string Data, and DataLength is updated with the new length, BytesRead is updated with the amount of bytes read. MaxLoop determines how often an attempt at reading data is made.

In the variant with a stream, the available data is simply written to the stream.

Errors

None.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.