Feature Request: ORIG()

Jay R. Ashworth jra at baylink.com
Wed Jan 17 09:02:24 PST 2007


On Wed, Jan 17, 2007 at 06:43:34AM -0800, Jeff Harrison wrote:
> > >>I believe that he wants to compare the current values
> > to the original values - if you want to do that at the
> > time the record is saved, then I believe that you do
> > need an array to store the original values.
> > >>>
> > 
> > The older Filepro manual has a solution for this that doesn't use a
> > lot of code.
> >
> > What you do is create a qualifier for the file. On entering update
> > copy the record to the qualified file and record the record number
> > of that record in a dummy field. When saving the record run a loop
> > to compare each field with the same field in the qualified record.
> > If you only have to compare the item records then simply start the
> > loop at that field. A simple MOD statement will tell you which of
> > the detail items of the associated fields you are dealing with.
>
> "simple MOD statement" ?? Can you give us some more detail here?
>
> It sounds like there would be quite a bit more IO with this approach -
> also, you mentioned that you would still need a loop... still if it is
> simplier to code I would be interested in hearing the details.

The ORIG(dummy) function would return the value of the field whose
number is in the variable provided to it as it existed when the record
first went into update mode after being positioned onto. Any changes
after that would not affect the internal copy of the record used to
provide the value for the ORIG() function, until the record pointer
was changed. As a special feature, calling ORIG("0") would reset the
internal array to the *current* version of the (possibly modified)
record, should a programmer feel this was a good thing to do.

Note that the indirection in the argument is critical, to permit it to
be used in loops.

Projected implementation time... oh, about a day.

Expected impact on current codebase: None.

:-)

Cheers,
-- jr 'happy to help' a
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274


More information about the Filepro-list mailing list