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_handle()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_HANDLE()
 Return the DOS file handle for a DBV file.
-------------------------------------------------------------------------------

 Syntax

    V_HANDLE( [<nArea> | <cAlias>] )      ->   nHandle

 Arguments

    <nArea> or <cAlias> refers to the number or name of the target DBV
    work area. If not specified, the current DBV work area is assumed.

 Returns

    V_HANDLE() returns a numeric integer whose value is the DOS file handle
    for the specified DBV work area.

 Description

    V_HANDLE() can be used in conjunction with Clipper's Fxxxx() class of
    low level file functions.  Great care must be taken when using FWRITE()
    to assure that the bounds of the VLF are not overwritten.  It is far
    safer and usually sufficient to use V_RETRIEVE() and V_POKE() to manage
    low level access to a VLF.

     +------------------------- WARNING ---------------------------+ 
     | Extreme care must be taken when using FWRITE() on a DBV     | 
     | type file.  Overwriting the bounds of a VLF by one byte can | 
     | corrupt the entire file.                                    | 
     +-------------------------------------------------------------+ 


 Examples

    #include "fileio.ch"
    LOCAL buffer

    // Open a DBF file and its related DBV file
    USE dbf_file
    V_USE( "dbv_file" )

    FSEEK( V_HANDLE(), V_PTR( vlf_fld ), FS_SET )

    buffer = SPACE( V_LEN( vlf_fld ) )
    FREAD( V_HANDLE(), @buffer, LEN(BUFFER) )

    // The above code will fetch a VLF without file locking or
    // error checking just like the following one line of code:
    //         buffer = V_RETRIEVE( vlf_fld )

See Also: V_POKE() V_RETRIEVE() V_PTR() V_LEN()

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