Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>com_read()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
COM_READ()

Syntax:     COM_READ(<port>[,<expN1][,<expL>])

Arguments:  <port> denotes which interface to read characters from,
            COM1: (1) or COM2: (2).
            [<expN1] will determine how many characters in the
            buffer are to be read.  If no value is passed, all characters
            will be read.
            [<expL>]) If false (.F.) or <expL> is not passed then all
            characters in the buffer will be read and removed from the
            buffer .  However, if a (.T.) <expL> is passed then the
            characters will be read, but not removed from the buffer,
            allowing them to be read again.

Returns:    A logical value.
            Contains the corresponding symbols from the buffer.

Usage:      All characters arriving at the serial interface will be stored in
            the corresponding buffer under interrupt control.  It is possible
            to determine the number of characters in the buffer, and to
            read one, several or all into the Clipper program.  All
            characters are read if <expN> is omitted.

            If a fault occurs when receiving characters from either of the
            serial ports, a CHR(177) will be stored in the respective
            buffer.  This will make identification of poorly received block
            more accurate.

Note:       It is possible to receive more characters between issuing a
            COM_COUNT() and a COM_READ().

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   DO WHILE COM_COUNT(1) < 10          && Wait until there
                                                && are 10 characters
            ENDDO                               && in the buffer.


            input = COM_READ(1,10)              && Read in 10
                                                && symbols.
            ? input                             && Display symbols
                                                && read.


See Also: COM_COUNT()

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