Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GetIt Reference Guide - syntax: n_updated([<namesa> ,] <dataa>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Syntax: N_UPDATED([<namesA> ,] <dataA>)

Compares array values to DBF fields

Returns zero if no change, otherwise number of (first) changed element

Example

* only update record if field(s) have really changed
SELECT Client
DECLARE fields[3],data[3]
CH_AINIT(fields,"Name","City","Phone")
N_SCATTER(fields,data)
@ 1,0 SAY "Name:" GET data[1]
@ 2,0 SAY "City:" GET data[2]
@ 3,0 SAY "Tel#:" GET data[3]
READ
IF UPDATED() .AND. N_UPDATED(fields,data) > 0
  N_GATHER(fields,data)
ENDIF

Notes

If only one array is specified then all fields in the DBF record are
compared with the corresponding array element.  The number of elements
compared is the smaller of the size of the array or the number of fields in
the DBF record.  If the array size is longer than the number of fields, then
the trailing array elements are ignored.

If two elements are specified then the first array is assumed to contain a
list of field names to be compared with the corresponding elements of the
second array.  The second array must be at least the same size as the first
array or the results will be undefined.

The element number of the field which has changed is returned.  If no fields
have changed, zero is returned.  If more than one field has changed, then
the array element of the first element to be changed is returned.

See Also: N_SCATTER N_GATHER

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