Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_scatter( [ <afields>, ] <adata> ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_SCATTER( [ <aFields>, ] <aData> )


Parameters

<aFields>
Optional array containing the names of the fields to store.

<aData>
Array in which to store data from fields in the currently selected 
record.


Returns
Number of fields scattered.


Description

Scatters data from fields of the current record to elements of an 
array.

If only one array is passed, then all fields in the current record are 
stored in a corresponding array element. The number of fields stored is 
equal to the lesser of:

        Number of elements in the array
        Number of fields in the record

If the number of fields in the record is greater than the number of 
elements in the array, then trailing fields are ignored.

If two arrays are passed, NetLib assumes that the first array contains 
names of fields to store in corresponding elements of the second array. 
The second array must have at least as many elements as the first, or 
the result is undefined (but probably undesirable).


Example

* Store all fields of current record
DECLARE aData[FCOUNT()]
SELECT Client
N_SCATTER(aData)

* Store selected fields
DECLARE aFields[3], aData[3]
aFields[1] = 'City'
aFields[2] = 'State'
aFields[3] = 'ZIP'
SELECT Client
N_SCATTER(aFields, aData)




See Also: N_GATHER() N_UPDATED()

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