Filepro-list Digest, Vol 36, Issue 17

Jeff Harrison jeffaharrison at yahoo.com
Tue Jan 16 10:30:30 PST 2007


--- George Simon <GSimon at americanriverintl.com> wrote:

> You don't really _have_ to use an array.  You can
> compare the existing and current fields when the
> user saves the record.
>  
> George Simon Sr. Programmer
> Information Technologies
> American River International
> 

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.

This is a good example of a reason why one should not
use associated fields in complex applications.  This
should have been done with two different files in a
header - detail relationship in my opinion.  Anyway...

Given that your fields are not contiguous - here is an
approach that should work - keep in mind that this is
untested, and that I don't have access to filepro
right now to check out the exact syntax on the
fieldname command - hopefully this will give you a
place to start at least.

You will need to reserve 32 contiguous dummy fields
for each of your "columns" (associated field groups),
also these should be defined as global and also
defined in automatic processing.

For example:

dim itemno(32)(10,*,g):aa
dim qtyord(32)(4,.0):ca
dim qtyshp(32)(4,.0):ea
dim allflds(999):1
@update:::
a=""; b=""; c=""    ' used as counters for each of you
associated field groups
y=""                     ' main counter
gosub getorig       ' subroutine to get the original
values into their arrays
end
getorig:::
clear itemno, qtyord, qtyshp  ' (etc.)
gloop:::
y=y+"1"
If: y gt "999"  '(use your field limit here)
Then: return
If: fieldname(-,y) eq "S0)"
Then: a=a+"1"; itemno(a)=allflds(y)
If: fieldname(-,y) eq "S1)"
Then: b=b+"1"; qtyord(b)=allflds(y)
If fieldname(-,y) eq "S2)"
Then c=c+"1"; qtyshp(c)=allflds(y)
goto gloop

The alternative of recording the changes as they are
made to each line item, while easier to program is a
bad idea in my opinion - the reason for this is - what
happens if the user decides to cancel the operation by
hitting DEL DEL after they have already changed a few
lines?  Too late, your changes have already been
written!  You would need to prevent them from doing
that - and let me tell you that users can be very
insistent in this respect!  They will find a way to
break out.

Good Luck.

Jeff Harrison
jeffaharrison at yahoo.com

Author of JHExport and JHImport, the fastest and
easiest ways to export and import filepro data.


 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121


More information about the Filepro-list mailing list