>Subject: Re: Determining if a field has been updated
>Date: 1 Sep 93 23:57:28 GMT
>>I was wondering how I can find out if a field (specifally a numeric field)
>>has ever been updated. By default, the field in the database is blank.
>Use the EMPTY() function. It works properly for all data types including
>Look up the function in the docs - pretty easy to use.
Empty() is only good for determining wheither a field contains an actual
value or not. i.e. Spaces. It does not tell you weither the field has
been updated unless the data has been initialised to spaces, zeroes first.
The best way to check wheither data has changed in get fields is to place
the fields into memory variables and GET the memory variables.
m.mem1 = dbfname.field1
m.mem2 = dbfname.field2
if m.mem1 = dbfname.field1 ;
and m.mem2 = dbfname.field2
* no update
replace dbfname.field1 with m.mem1, ;
dbfname.field2 with m.mem2
I always get the memory variables instead of the database fields as it
gives better control of the data which gets stored to the database. If
you append blank records to the database everytime the user selects add
new record, the database would get filled with blank records as
occasionally, the uses aborts an append half-way through. It is better
to do the append once the data to add has been validated.
Just my 2 bits.