Comparing record with original when saving
Jeff Harrison
jeffaharrison at yahoo.com
Wed Jan 17 11:08:36 PST 2007
--- 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.
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
More information about the Filepro-list
mailing list