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_set_recurse()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_SET_RECURSE()
 Set FlexFile to disable recursive array checking
-------------------------------------------------------------------------------

 Syntax

    V_SET_RECURSE( [<lOnOff>] )    ->   lOldSetting

 Arguments

    <lOnOff> is a logical expression.  If true (the default), then
    Flexfile will check for arrays with circular references (see
    description below).  If omitted, the function has no affect except to
    return the old setting of this value.

 Returns

    V_SET_RECURSE() returns the setting before the call to this function.

 Description

    FlexFile uses recursion in order to save and restore Clipper 5.0 arrays
    and objects.  If you have an array that is self-referencial (see
    example below) or a Clipper or Class(y) object, then pure recursion
    will call itself indefinately, eventually exhausting Clipper's stack.

    Therefore, a modification was added to the array saving and restoring
    process to check for these circular references.  However, the check
    takes both time and memory.  Even though this overhead is marginal, we
    decided (for all you speed freaks out there) that we would allow you to
    disable the circular array reference check.  After all, most
    applications will never have circular references.

    Passing V_SET_RECURSE() a (.F.) will set the recursion checking off for
    a marginal speed increase.  Remember, reference checking is ON by
    default so that saving of objects is seemless.


 Examples

    // Declare an object and a circular array variable
    LOCAL obj, circ_arr

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

    // Create an object
    obj = TBROWSENEW( 5, 5, 20, 50 )

    // Create an array that has a circular array reference and an object
    circ_arr = { "first element", "second element", NIL, NIL }
    circ_arr[3] = circ_arr
    circ_arr[4] = obj

    // Set the recursion checking on in order to save these to disk.
    lOld_set := V_SET_RECURSE(.t.)

    dbf_file->vlf := V_REPLACE( circ_arr, dbf_file->vlf )

    // Put this setting back to its old value.
    V_SET_RECURSE( lOld_set )

See Also: V_REPLACE()

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