Change log file

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Change log file

#1 Post by omni »

Roger,

We have a few major files that we keep track of certain fields, when they are updated, by whom, and retain in a history by reference, thus allowing users to see who changed what and when.
Our larger users want this for all master files, employees, customers,etc. There are probably a dozen files involved with anywhere from 15-50 fields each. Have you seen a method to check the fields before and after to see if changed without going thru the tedious code to check each var against the field, one by one, and recording in the history log. These programs, some written last century originally, have programmer defined variables, many added and deleted over the years.

Thanks

Fred
Omni

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Change log file

#2 Post by rdonnay »

I'm not sure how to answer this.

I would probably use Scatter() to Scatter the fields into an array and them use DC_ACompare() to compare the arrays.

Code: Select all

aArray1 := CUSTOMER->(Scatter())

.. modify record

aArray2 := CUSTOMER->(Scatter())

IF !DC_ACompare( aArray1, aArray2)
  DCMSGBOX 'Something has been changed!'
ENDIF
The eXpress train is coming - and it has more cars.

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Change log file

#3 Post by RDalzell »

Roger,

You have an example which performs this really well, dbnotify().

I put in my wish list the docs for it, appears to be the cure.

Rick

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Change log file

#4 Post by rdonnay »

Rick -

I forgot about that.
In fact, I even wrote a sample program:
\exp19\samples\dbnotify\dbnotify.prg

Thanks

Roger
The eXpress train is coming - and it has more cars.

Post Reply