[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
V_FILLARR()
Fill a Clipper array with contents stored to a DBV file
-------------------------------------------------------------------------------
See V_ARETRIEV() for retrieving Clipper 5.0 arrays
Syntax
V_FILLARR( <aTarget>,
<cPointer>,
[<nArea> | <cAlias>] )
Arguments
<aTarget> is the Clipper array to be filled.
<cPointer> is a six byte pointer-field that points to the DBV
containing a Clipper type array.
<cAlias> or <nArea> is a DBV file alias or area specified when the
file was V_USE()d. If omitted, the pointer will point into the
currently selected DBV area.
Returns
None. However, <aTarget> is modified.
Description
V_FILLARR() is used to fill a Clipper S'87 type array. The <aTarget>
array must exist and will be filled until <aTarget> has no
remaining elements or the array pointed to by <cPointer> has no
more elements (which ever limit is reached first).
Use the V_LEN() function to dimension the array immediately before
V_FILLARR() (see examples below).
The ability to save Clipper arrays is one of the most powerful
features of FlexFile. Essentially, it simulates Variable Length
Records as well as creating a three dimensional effect in your
data base files.
For example, picture a student master DBF file with the fields
LastName, FirstName, Addr, Major, and Minor. If you decide to
expand the file and include the sports, clubs and associations
that the student is involved in, you have two choices. You can
create a new related file (with a new index), or you can insert
several new fields in the master DBF for each category, limiting
the entries possible in any one category and wasting space on
students who do not have entries in one or more of the categories.
With FlexFile, however, you can add just one field in the master
file and save an array of any length to this field. Not only do
you eliminate a file, its index, and its relation, but also, one
function call can load arrays with the new data eliminating the
need to code "scatter" and "gather" routines.
Notes
. You must use this function from within a Clipper 5.0 application
only to retrieve an array which was stored with a FlexFile S87
library version 1.01 or less (version 1.01 was dated 2/18/91).
See V_FILLEN() for an example of a conversion routine.
. It is not necessary to use this routine to retrieve a FlexFile
type array.
Examples
&& S'87 compiler only. See V_ARETRIEV() for Clipper 5.0
&& Open a DBF and a related DBV file
USE dbf_file
V_USE( "dbv_file" )
DECLARE aNames[3]
aNames[1] = "Tania"
aNames[2] = "Mary"
aNames[3] = "Allison"
&& Store the array to the DBV file and its pointer to the DBF
REPLACE vlf WITH V_REPLACE( aNames, vlf )
&& Declare the new array to the proper size.
DECLARE aNewNames[ V_LEN( vlf ) ]
&& Fill the array with the data.
V_FILLARR( aNewNames, vlf )
&& Show that it worked
? aNewNames[1] && Result: Tania
See Also:
V_FILLEN()
V_ARETRIEV()
V_AREPLACE()
V_REPLACE()
V_LEN()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson