Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>open allow file or device i/o</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OPEN                     Allow File or Device I/O

 (1) OPEN filespec [FOR mode1] AS [#]filenum [LEN=recl]

     or

 (2) OPEN mode2, [#]filenum, filespec [,recl]

    Makes a file or device available for reading or writing.

    filespec    A string expression that follows DOS file naming
                conventions.

     filenum    An integer expression. The number to use when referring to
                the file.

        recl    An integer expression in the range 1 to 32767. Sets the
                record length for random files and the capacity of the I/O
                buffer for sequential files. Defaults to 128.

       mode1    (Syntax 1) One of the following (default is RANDOM):

                    INPUT     Sequential input
                    OUTPUT    Sequential output
                    APPEND    Sequential output beginning at EOF
                    RANDOM    Random input/output
                    BINARY    Binary input/output

       mode2    (Syntax 2) A string expression whose first character must
                be one of the following:

                    I         Sequential input
                    O         Sequential output
                    A         Sequential output beginning at EOF
                    R         Random input/output
                    B         Binary input/output

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

      Notes:    The OPEN statement has additional optional arguments when
                the device being opened is COM1: or COM2:. See OPEN
                "COM..."

                Opening an existing file for sequential output destroys
                the current file contents; to add to the current file,
                open it for APPEND (the APPEND mode may be used only for
                sequential disk files).

                A file that is already open may not be opened for
                sequential output or append.

                Opening a nonexistent file for APPEND is equivalent to
                opening it for OUTPUT.

                Opening a nonexistent file for INPUT results in runtime
                error 53 (File Not Found).

                Disk files and printers may be opened for either
                sequential or random access. All other standard devices
                may be opened only for sequential access.

See Also: CLOSE OPEN "COM...

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