Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>v_files()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_FILES()
 Set the maximum number of DBV files to be in use concurrently
-------------------------------------------------------------------------------

 Syntax

    V_FILES( [<nMaxFiles>] )    ->    nCurrentMax

 Arguments

    <nMaxFiles> is the maximum number of DBV type files that can be in
    V_USE() concurrently. If none is specified, V_FILES() will simply
    return the current setting.

 Returns

    V_FILES() returns the current setting of the maximum file count.

 Description

    V_FILES() offers the programmer the opportunity to set the maximum
    number of files that the program will have in use at any one time.
    This feature allows FlexFile to keep the memory used for the file
    headers in a contiguous block which avoids memory fragmentation.

    Each file requires 84 bytes for the header information. Therefore,
    multiply the <nMaxFiles> by 84 in order to calculate the total
    memory requirement for the files opened in your system.

 Notes

  . The maximum number of files cannot be changed unless all DBV files are
    closed.

  . This function is independent of the V_BUFFERS() setting.

 Examples

    // Set FlexFile's maximum file count to 2 files
    V_FILES(2)

    V_USE( "file1" )         // Open first file.
    V_USE( "file2", ,"NEW" ) // Open second file
                             // in a new area.

    // Attempt to open a third file in a new area fails.
    IF V_USE( "file3", ,"NEW" ) == -1
       ? "Too many files in use."
       ? V_ERROR()        // Result: 8001
    ENDIF

    // This line has no effect because files are open.
    V_FILES(5)

    ? V_FILES()           // Result: 2

See Also: V_BUFFERS() V_USE()

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