[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FOPEN()

    FOPEN() opens a DOS file.

Syntax

    FOPEN(<expC>,[,<expN>])

Argument

    <expC> is the name of the file to open including the path if there is
    one.

    <expN> is the requested DOS open mode indicating how the open file can
    be accessed.  Access falls into three categories:

                              DOS File Open Modes
    Open Mode       Operation
        0           Read only
        1           Write only
        2           Read/write

    The default open mode is zero.

Returns

    A numeric value.

    FOPEN() returns the file handle of the opened file in the range of zero
    to 65,535.  If an error occurs, it returns -1.

Usage

    Since a file handle is required in order to identify an open file to
    other file functions, always assign the return value from FOPEN() to a
    memory variable for later use.

    Accessing files in other directories: FOPEN() does not obey either
    the DEFAULT or PATH SETtings.  Instead, it only searches the current
    directory unless a path is explicitly stated.

Example

    handle = FOPEN("Temp.txt"                      
    IF FERROR() <> 0                               
       ? "Cannot create file, DOS error ", FERROR()
    ENDIF                                          

WARNING: This function allows low level access to DOS files & devices.
             They should be used with extreme care and require a thorough
             knowledge of the operating system.

See Also: FCLOSE FCREATE FERROR FREAD FREADSTR FSEEK FWRITE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson