This function checks if any data is available on the pipe to read. Use this function before a CLReadPipe command.

The command is as follows:

rc = CLPeekPipe( '0' )

The return value rc is made up of the following information: piperr charcount pipestate

Piperr is any possible error the DOSPeekNPipe command may have caused. DosPeekNPipe returns the following values:
0 NO_ERROR
230 ERROR_BAD_PIPE
231 ERROR_PIPE_BUSY
233 ERROR_PIPE_NOT_CONNECTED

charcount is the number of characters available to read from the pipe.

pipestate is the state the pipe is currently at. Possible values are:
1 = the pipe is disconnected.
2 = the pipe is listening for a connection.
3 = the pipe is connected.
4 = the pipe is closing.

Example peek pipe. Command:
rc = CLPeekPipe( '0' )

Contents of rc:
0 12 3

There are 12 characters available to read
from the pipe and the pipe is connected.