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_open()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
COM_OPEN()

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

Arguments:  <port> denotes which interface to open, 1 for COM1: or 2 for
            COM2:.
            [<expN1] defines the size of the buffer for the interface
            concerned.  The value can lie between 100 bytes and 64K,
            with invalid parameters being automatically corrected to
            default values.
            [<expL>]) triggers an interrupt when the data arrives if set to (.T.)

Returns:    A logical value.
            If the interface has been opened and setup successfully, the
            desired buffer (.T.) will be returned.

Usage:      This function can be used to open either COM1: or COM2:.
            Although it has become normal practice to speak in terms of
            COM1: or COM2:, these are simply names of DOS I/O
            devices.  Accurately speaking, we are referring to interface 1
            (COM1:) having an I/O address of 3F8H, and interface 2
            having an I/O address of 2F8H.  A buffer sized up to 64K is
            initialized when opening the interface.  This buffer is used to
            store incoming characters.  The number of characters in the
            buffer can be obtained via other functions,and any number of
            them can be read in.

Note:       Them minimum size of the buffer will be 100 bytes regardless
            of its specification.

Library:    CT1.LIB


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

Examples:   IF NUMCOM() > 0

               buff_size = 4000                    && 4000 byte buffer

               com_ok = COM_OPEN(1,buff_size)      && COM1: open

               IF .NOT. com_ok
                  ? "It was not possible to open interface."
               ENDIF

            ENDIF



See Also: COM_COUNT() COM_INIT() COM_READ()

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