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_vlf2file()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_VLF2FILE()
 Create a DOS file and fill it with the contents of a VLF
-------------------------------------------------------------------------------

 Syntax

    V_VLF2FILE(  <cFileName>,
                 <cPointer>,
                 <cMode>  )     ->    lSuccess

 Arguments

    <cFileName> is the name of a file to append to or overwrite with
    the data from a VLF associated with <cPointer>.

    <cPointer> is a six byte pointer-field (FlexFile's version of a
    memo-field).

    <cMode> is a character code telling FlexFile to <A>ppend or
    <O>verwrite any existing file with the same name as <cFileName>.
    The default mode is <A>ppend.

 Returns

    V_VLF2FILE() returns (.T.) if the data was copied successfully,
    otherwise, it returns (.F.).

 Description

    V_VLF2FILE() copies a Variable Length Field from a DBV type file
    to a DOS file. This is particularly useful when using graphics
    applications from within Clipper that require individual files for
    images.


 Examples

    // Setup variable
    LOCAL pic_name

    // Open a DBF, NTX and DBV library of graphics images.
    USE ( pic_lib ) INDEX ( pic_lib )
    V_USE( pic_lib )

    // Allow the user to enter the name of a graphic image
    // to view, create a temporary disk file, print the
    // file to screen.

    WHILE ( .T. )
       pic_name = SPACE(11)
       @ 5, 5 SAY "Enter the image name to view: " GET pic_name
       SEEK pic_name
       IF FOUND()

          // Write DBV data to a temporary file.
          V_VLF2FILE( "graphic.pic", vlf_ptr )

          // Use one of the graphic function libraries to retrieve a file.
          file2graph( 0, "graphic.pic" )

          INKEY(0)

       ELSEIF LASTKEY() == 27
          EXIT

       ELSE
          ? "Image not found"

       ENDIF
    ENDDO

See Also: V_FILE2VLF() V_REPLACE() V_DELETE()

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