Comparing record with original when saving

Jeff Harrison jeffaharrison at yahoo.com
Wed Jan 17 12:59:52 PST 2007


--- GCC Consulting <gccconsulting at comcast.net> wrote:
[snip]
> 
> 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
>  

Great!  We are getting close here to a very simple and
efficient approach.  You wouldn't fill the arrays
though, as they would automatically contain the data
in the associated fields.  You would need to copy the
arrays, or use George's approach of a same record
lookup.

How about this for a simple (untested) solution, that
would eliminate the step of copying the values into
arrays?

dim item_org(32):lookupalias(s0) )
dim ord_qty_org(32):lookupalias(s1) )
dim item_now(32):s0
dim ord_qty_now(32):s1
' 
gosub chkqty   ' check if any quantities changed
' ... do some other stuff
end
checkqty:::
lookup lookupalias = filename r=(@rn) -n
ct=""
cloop:::
ct=ct+"1"
If:ct gt "32" 'use actual associated field count
Then: return
If: ord_qty_org(ct) ne ord_qty_now(ct)
Then: ' handle it! 
goto cloop

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