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_updated( [ <afields>, ] <adata> ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_UPDATED( [ <aFields>, ] <aData> )


Parameters

<aFields>
Optional array containing the names of fields.

<aData>
Array of values to compare with fields in the currently selected 
record.


Returns

Number of the first array element that differs from its corresponding 
field. Zero if no element differs from its corresponding field.


Description

If only one array is passed, then each field in the current record is 
compared with a corresponding array element. The number of fields 
compared is equal to the lesser of:

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

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

If two arrays are passed, NetLib assumes that the first array contains 
names of fields to compare with corresponding elements of the second 
array. The second array must have at least as many elements as the 
first, or the result is undefined.


Example

* Update record if a field has changed
DECLARE aFields[3], aData[3]
SELECT Client
CH_AINIT(aFields, 'Name', 'City', 'Phone')
N_SCATTER(aFields, aData)
@ 1, 0 SAY 'Name: ' GET aData[1]
@ 2, O SAY 'City: ' GET aData[2]
@ 3, O SAY 'Phone: ' GET aData[3]
READ
IF UPDATED() .AND. N_UPDATED(aFields, aData) > 0
   N_GATHER(aFields, aData)
ENDIF




See Also: N_GATHER() N_SCATTER()

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