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_delete()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_DELETE()
 Delete one field from a DBV file
-------------------------------------------------------------------------------

 Syntax

    V_DELETE(  <cPointer>,
                 [<nArea> | <cAlias>] )    ->    cNull

 Arguments

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

    <nArea> or <nAlias> is the DBV work area or alias with which
    <cPointer> is related.

 Returns

    V_DELETE() returns a null string ("").

 Description

    V_DELETE() releases the space pointed to by <cPointer>. This space
    is then available for use by the next call to V_REPLACE() or any
    other function that requires DBV space. It is important to
    remember that there is no V_RECALL(). That is, once a DBV has been
    V_DELETE()d, that field is no longer recoverable.

    When you delete a record in a DBF file and you want to be able to
    recall that record (and its related VLF), do not use V_DELETE().
    Instead, just DELETE the record in the DBF. When you are ready to
    PACK the DBF, run a routine similar to the example below.

      +------------------------ WARNING -------------------------+ 
      | V_DELETE() deletes the data associated with <cPointer>.  | 
      | Attempting to use <cPointer> after this function deletes | 
      | the data that it points to can corrupt the DBV file.     | 
      +----------------------------------------------------------+ 

 Notes

  . V_DELETE() is permanent; there is no V_RECALL().

  . V_DELETE() is not necessary before a V_REPLACE(). The second
    parameter of V_REPLACE() is a pointer whose data space will be
    released before the REPLACE.

 Examples

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

    // Store some data in the DBV and a pointer to the
    // data in a six byte pointer-field in the DBF
    REPLACE vlf WITH V_REPLACE( "This string is doomed", vlf )

    // Now delete that string.
    REPLACE vlf WITH V_DELETE( vlf )

    // Note: It is important to erase the pointer stored in
    //       vlf once its data has been deleted.  Because
    //       V_DELETE() returns a null string, REPLACEing <vlf>
    //       guarantees that the pointer-field vlf will be
    //       destroyed.

See Also: V_REPLACE() V_STUFF()

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