Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- QuickBASIC 3.0 - <b>open com... open a communications file</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OPEN "COM...             Open a Communications File

 OPEN "COMn: [speed] [,parity] [,data] [,stop] [,RS] [,CS[m]] [,DS[m]]
 [,CD[m]] [,LF] [,BIN] [,ASC]" [FOR mode] AS [#]filenum [LEN=num]

    Opens a communications device for input and output via GET and PUT.

    Required arguments:

           n    A numeric expression. Must be either 1, for COM1:, or 2,
                for COM2:. An asynchronous adapter must be installed.

     filenum    An integer expression specifying a valid file number.

    Optional arguments (all must be constants):

       speed    Transfer rate, in bits per second. Default: 300. Other
                legal values: 75, 110, 150, 600, 1200, 1800, 2400, 4800,
                and 9600.

      parity    Type of parity checking, if any. Default: E, for EVEN.
                Other legal values: S (SPACE), O (ODD), M (MARK), and N
                (NONE). parity must be set to N if data is set to 8.

        data    Number of data bits to be transmitted. Default: 7. Other
                legal values: 5, 6, and 8.

        stop    Number of stop bits. Must be 1 or 2. Default: 2, for 75
                and 110 bps; 1, for all other transmission rates.

          RS    If included, suppresses RTS (Request to Send). If not
                included, OPEN "COM..." automatically turns the RTS line
                on.

         CSm    If included, controls CTS (Clear to Send). m specifies, in
                milliseconds, the delay before a timeout occurs. Default:
                1000. Acceptable values: 0 to 65535. If m is 0, the CS
                argument is ignored. If RTS is suppressed via the RS
                parameter, the default CS time is 0 milliseconds.

         DSm    If included, controls DSR (Data Set Ready). m specifies,
                in milliseconds, the delay before a timeout occurs;
                acceptable values are 0 to 65535. Default: 1000. If m is
                0, the DS argument is ignored.

         CDm    If included, controls CD (Carrier Detect). m specifies, in
                milliseconds, the delay before a timeout occurs;
                acceptable values are 65535. Default: 0. If m is 0, the CD
                argument is ignored.

          LF    If included, sends a line feed after each carriage return.

     LEN=num    If included, num specifies the maximum number of bytes
                that can be read from the communications buffer via GET or
                PUT. Default: 128.

         BIN    Opens the device in binary mode. This argument overrides
                an LF argument.

         ASC    Opens the device in ASCII mode. Tabs are converted to
                spaces, carriage returns are issued at the end of each
                line, Ctrl-Z is read as EOF, and XON/XOFF is enabled.

    FOR mode    mode may be OUTPUT, for sequential output, or INPUT, for
                sequential input. If this argument is omitted, the device
                is opened for random access (input and output).

   -----------------------------------------------------------------------

      Notes:    The speed, parity, data, and stop arguments must be
                presented in that order. Use commas as placeholders for
                omitted arguments.

                The remaining arguments--RS, CS, DS, CD, LF, BIN, and ASC
                may be specified in any order.

                Communications devices are opened in binary mode by
                default, unless an ASC argument is included in the OPEN
                COM statement.

See Also: COM(n) ON COM

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