Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very complicated coding...
Message
From
09/06/1999 12:40:33
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Very complicated coding...
Miscellaneous
Thread ID:
00227974
Message ID:
00227974
Views:
53
I will explain as best I can for what we need to program with VFP 6.0. Since I can explain best if I use DO CASE so we can see the point better with little "english".

There are three tables (all in one DBC):
WORKPO.dbf (and field "po" is CDXed) "working table"
HISTPO.dbf (and field "po" is CDXed) "history table"
DELEPO.dbf (just in case we need to look back...) "deleted data"

What happens is we import data into WORKPO.dbf and then see if there is a match in HISTPO.dbf. It goes like this:

SEEK or SCAN or LOCATE for WORKPO.po = HISTPPO.po
DO CASE
IF FOUND()
SELECT WORKPO
COUNT FOR how many "po" TO po1
SELECT HISTPO
COUNT FOR how many "po" TO po2
DO CASE
CASE po1 <> po2
remove all matched "po" to DELEPO
APPEND new matched "po" into HISTPO
CASE po1 = po1 AND there are only one "po" in both tables
check all the fields of that "po"
IF all fields matched
leave it alone and EXIT/LOOP to the next record in WORKPO
ELSE
remove matched "po" from HISTPO to DELEPO
APPEND new matched "po" (new updated data)
ENDIF
CASE po1 = po2 AND there are more than one "po" on both tables
(or OTHERWISE)
******************************************
** this is where I need to figure out!! **
******************************************
say suppose there is 4 "po" on both tables, I need to check
record by record, and once a record matches (all fields), I need to MARK that record so I don't check that same record again with the next
matching "po", did you follow this?

Chuck
Today is tomorrow's yesterday.
Next
Reply
Map
View

Click here to load this message in the networking platform