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 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]


              Saving and Retrieving Clipper's arrays


   Saving and retrieving Clipper S'87 arrays

   To save a an array using the S'87 version of the library
   (Flex_S87.lib), you treat the array like any other variable.
   For example,

       && Declare an array
       DECLARE arr[100]

       && Put some junk in it.
       afill( arr, "Solid waste" )

       && Save the array (assume a DBF and DBV are open).
       REPLACE vlf WITH V_REPLACE( arr, vlf )

   To retrieve that same array in S'87 takes more than one line of code.
   Remember that V_LEN() returns the total number of elements in
   a S'87 array.

       && Assume that we are still on the same record in
       && the DBF but we do not already have a declared array.
       && First we need to DECLARE the array to be the size of
       && the array we stored above.
       DECLARE newarr[ V_LEN(vlf) ]

       && Now we fill the array.
       V_FILLARR( newarr, vlf )

   Although that was slightly awkward that is all there is to it.


   Saving and retrieving Clipper 5.0 arrays

   To save an array with the Clipper 5.0 library (FlexFile.lib)
   you treat the array like you would any other Clipper variable.

      // Save the original array
      REPLACE vlf WITH V_REPLACE( arr, vlf )

      // Retrieve it later
      newarr = V_RETRIEVE( vlf )

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