[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Saving and Retrieving Clipper's arrays
+-------------------------Warning-----------------------------------+
| Arrays saved with FlexFile's S87 library version 1.01 and |
| earlier cannot be retrieved directly with FlexFile's Clipper |
| 5.0 V_ARETRIEV() function. Instead, see the documentation on |
| V_FILLARR() and V_FILLEN(). Arrays saved with later versions |
| of FlexFile are compatible between the two version as long as |
| the array is one dimensional. |
+-------------------------------------------------------------------+
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
except that instead of using V_REPLACE() and V_RETRIEVE() you
need to use V_AREPLACE() and V_ARETRIEV(). Remember
V_ARETRIEV() can only be used on arrays that were saved with
V_AREPLACE() (see the warning above).
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson