Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Book 4-Appendices - <b>ppcread()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 PPCREAD()
 Reads data from a communication receiving buffer
------------------------------------------------------------------------------
 Syntax

     PPCREAD(<nHandle>,[<nLength>],[<lNotDelete>])
         --> cString

     Netware: 2.2 and 3.11

 Arguments

     <nHandle>  Designates the communication buffer from which the
     receiving buffer is read.

     <nLength>  Designates the number of characters that are read.  The
     default value reads all characters.

     <lNotDelete>  Designates whether the characters are deleted (.F.) or
     not (.T.) after the buffer has been read.  The default value (.F.)
     indicates that the characters are deleted.

 Returns

     PPCREAD() returns a character string that contains the characters that
     have been read from the receiving buffer.  If an error occurs (for
     example, if the handle is invalid or the communication buffer has no
     receiving buffer), the function returns an empty string.

 Description

     PPCREAD() allows you to read data from the receiving buffer of any
     communication buffer, independently of the protocol used (IPX, SPX,
     NetBIOS datagram, or NetBIOS session).  The handle of the communication
     buffer must be specified with <nHandle>.  If only one communication
     handle is passed, the function returns all characters of the receiving
     buffer.  By designating <nLength>, a defined number of characters can be
     read.  With the parameter <lNotDelete>, you can specify if the buffer is
     cleared (.F.) or not (.T.) after the characters have been read.

     Reading only a defined number of characters can be useful if the header
     of a data packet is also transmitted to the receiving buffer during an
     IPX or SPX communication.  In this case, the header can be read first
     (30 or 42 characters).  The header contains information about the length
     of the data range that can then be read with a new call of PPCREAD()
     (see the introduction to this chapter).  In this way, the data that is
     read can be packet oriented.

 Note

     .  Between a call of PPCRECCNT() and PPCREAD(), new data can be
        transmitted to the receiving buffer.

 Examples

     .  Read and display all the characters from a receiving buffer:

        ? PPCREAD(nHandle)

     .  Read the header and the data range of an IPX packet
        separately:

        // Open communication buffer
        // Force header transfer

        nHandle=IPXOPEN(20000,5000,,,,,.T.)

        // Read IPX header (30 bytes)
        cHeader=PPCREAD(nHandle,30)

        // Determine data range length
        // (Attention: high, low sequence)
        nLen=BIN2I(CHARMIRR(SUBSTR(cHeader,3,2)))-30
        // Read data range
        cData=PPCREAD(nHandle,nLen)

See Also: PPCRECCNT() PPCWRITE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson