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_retrieve() / v_ret()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_RETRIEVE() / V_RET()
 Return data that has been stored in a DBV file
-------------------------------------------------------------------------------

 Syntax

    V_RETRIEVE(  <cPointer>,
                 [<nArea> | <cAlias>],
                 [<nStart>],
                 [<nCount>] )    ->    Data

 Arguments

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

    <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.

    <nStart> is the starting position in <cPointer>'s data. If
    <nStart> is positive, it counts from the beginning of the data
    pointed to by <cPointer>. If <nStart> is negative, it counts from
    the end of the data pointed to by <cPointer>.

    <nCount> is how many bytes of data to retrieve. If omitted,
    <nCount> begins at <nStart> and goes to the end of the data. If
    <nCount> is larger than the data, the excess is ignored.

 Returns

    V_RETRIEVE() will return the data pointed to by <cPointer>. On
    error, V_RETRIEVE() will return an empty value of the type stored
    or a logical (.F.) if no type can be determined. Use V_ERROR() to
    fetch the error code associated with a failed RETRIEVE().

 Description

    V_RETRIEVE() retrieves data stored in a DBV type file. The data
    retrieved will have the same type as the data that was stored
    during the V_REPLACE() (with the notable exception of Clipper
    arrays which are discussed below and Proclip windows which use the
    V_WNDCREAT() function).

 Notes
  . Clipper arrays stored using the V_REPLACE() function cannot be
    retrieved with V_RETRIEVE() when using the S87 compiler. Instead, use
    V_FILLARR() for Summer 87 type arrays.

  . <nStart> and <nCount> only apply to character data.  They will
    be ignored for any other data types.

 Examples

    // Open the DBF file and its associated DBV file
    #define CR_LF  ( CHR(13) + CHR(10) )
    LOCAL cStr
    USE dbf_file       // Has a 6 byte pointer-field: vlf.
    V_USE( "dbv_file" )// Is created if it does not exist.

    cStr ="And the silken, sad, uncertain,"+ CR_LF +;
          "rustling of each purple curtain,"+ CR_LF +;
          "thrilled me, filled me,"       + CR_LF +;
          "with fantastic terrors never felt before."

    // Store the string in DBV file and its pointer in
    // the DBF.
    APPEND BLANK
    REPLACE author WITH "Poe"
    REPLACE poem WITH "The Raven"
    REPLACE vlf WITH V_REPLACE( cStr, vlf )

    // Edit the string using V_RETRIEVE().
    cStr = MEMOEDIT( V_RETRIEVE( vlf ), 0, 0, 10, 45 )

    // Save the edited poem.
    REPLACE vlf WITH V_REPLACE( cStr, vlf )

See Also: V_FILLARR() V_REPLACE() V_STUFF() V_LEN()

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