Comparing record with original when saving
GCC Consulting
gccconsulting at comcast.net
Wed Jan 17 11:27:19 PST 2007
> -----Original Message-----
> From:
> filepro-list-bounces+gccconsulting=comcast.net at lists.celestial
> .com
> [mailto:filepro-list-bounces+gccconsulting=comcast.net at lists.c
> elestial.com] On Behalf Of Jeff Harrison
> Sent: Wednesday, January 17, 2007 2:09 PM
> To: Boaz Bezborodko
> Cc: filepro-list at lists.celestial.com
> Subject: Re: Comparing record with original when saving
>
> --- Boaz Bezborodko <boaz at mirrotek.com> wrote:
>
> > If you have 32 "line items" with 5 fields per line item
> then you would
> > have a loop of between 1 and 160. Add the offset for the
> file record
> > comparison. (IOW, if the line-items start at field 10 then loop
> > between "1" and "160" and add "10" to the fields you are
> > comparing.) To find
> > out which line item you are dealing with simply divide the current
> > instance of the loop by 5 and the integer is the particular
> line-item
> > you're dealing with. To find out which field then enter a line
> > something like this:
> >
> > aa=MOD(n,"5")+"1"
> >
> [snip]
>
> Yes, I have used similar techniques in the past. The problem
> here though, according to my understanding, is that the
> fields are not contiguous. One needs a generic solution that
> does not depend on the fields being laid out neatly.
If one is running 5.6, you can dim and array to the associated field so they
don't have to be contiguous.
All that is required is an array for each associated field level'
Dim item_org(32):s0;dim ord_qty(32):s1 etc
This makes handling no contiguous associated fields easier.
One can then use the methods shown to fill each of these arrays and also
have arrays which hold the changes.
Comparing the starting array element to the ending array matching element
looking for a change. If any one array element changed, process the change
for that line item from each of the arrays.
Richard Kreiss
GCC Consulting
>
> Hopefully, at least within the detail section, a consistent
> ordering of the fields is maintained. If that is the case
> then it would be possible to do the compare using George's
> technique of the lookup to the same @rn. You could have two
> arrays - one mapped to the current file, and one to the
> "looked up" current file. Then at save time loop through
> them checking for any differences in the ship-to quantity
> field (using the fieldname command to check if it is the
> right field). If there is a change, then use the appropriate
> algorithm to figure out the field number of the appropriate
> item number and you are all set.
>
> Jeff Harrison
> jeffaharrison at yahoo.com
>
> Author of JHExport and JHImport. The fastest and easiest
> ways to export and import Filepro data.
>
>
>
>
> ______________________________________________________________
> ______________________
> Don't pick lemons.
> See all the new 2007 cars at Yahoo! Autos.
> http://autos.yahoo.com/new_cars.html
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list