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

Syntax:     COM_INIT(<port>[,<expN1>][,<expC>][,<expN2>][,<expN3>])

Arguments:  <port> denotes the interface (1 or 2) which should be
            initialized.
            [<expN1>] denotes the desired baud rate for the interface.
            (300, 600, 1200, 2400, 4800, 9600 and 19200 baud)
            [<expC>] The parity is indicated by a single character string
            in the following manner: "E" (even), "O" (odd), "M" (mark), "S"
            (space), "N" (none),
            [<expN2>] The data length, 7 or 8 bits.
            [<expN3>] The last argument will determine the  number of
            stop bits, 1 or 2.

Returns:    A logical value.
            (.T.) will return if it was possible to set all the
            arguments successfully.

Usage:      Once the serial interface has been opened, this function is
            used to set  the transmission speed (baud rate), the data
            length, parity and the number of stop bits.  For example,
            in most mailboxes, a 300 to 2400 baud, 8, N, 1 cofiguration
            is common.  This means eight data bits, no parity and one
            stop bit.  It is important to be able to change all these
            arguments before the interface has been opened.  Neither
            the data buffer or the status register (DTR, ect.) will
            then be affected.

Note:       The interface must be opened before initialization.  It is
            not possible to initialize the interface before opening.  The
            standard setting of 300 baud, no parity, 8 data bits and 1
            stop bit will be used for arguments which are either not
            supplied, or are incorrectly indicated.

Library:    CT1.LIB


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

Examples:   buff_size = 4000                    && Buffer for 4000
                                                && Symbols
            com_ok = COM_OPEN(1,buff_size)      && Open interface

            IF com_ok
               * The interface is now open and it will now be
               * necessary to initialize using 1200 baud,
               * no parity, 8 data bits and 1 stop bit.

               init_ok = COM_INIT(1, 1200, "N", 8, 1)
               IF .NOT. init_ok
                  ? "It was not possible to initialize" + ;
                    "the interface"
               ENDIF
            ENDIF

            It would also have been possible in the above example to
            omit the last three arguments with COM_INIT(), since they
            correspond to the preliminary setting.

            init_ok = COM_INIT(1, 1200)         && Initialize with
                                                && 1200,N,8,1.



See Also: COM_CLOSE() COM_OPEN()

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