Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETNEXTMODIFIED with new records
Message
From
11/06/1998 16:44:30
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00106948
Message ID:
00107366
Views:
22
>>I am using GETNEXTMODIFIED in grids to scan changed records and use the data enetered to update fields in other files. The problem is, there can also be new records in the grid and when GETNEXTMODIFIED hits them, VFP tells me that buffering is not enabled (it is) What is the easiest way around this. I am trying to do it in one section of code. Do I have to code differently for new records? Any help appreciated
>
>I am not sure I get the problem here. I can GetNextModified() without a problem.
---- stuff removed for brevity -----
>Are you doing something conceptually different?

Here is the code I am using. In test I have changed record 1, 3, 7 and added one record -1. It starts with 1 goes to 3 then 7 then -1. It works fine until it does the qty update for the new record and then when trying to get a return of 0 using GETNEXTMODIFIED(lnchgrec) where lnrec is -1 it gives me the aforementionned error.

SELECT polines
SET FILTER TO polines.ponumber = poheader.ponumber
lnchgrec = GETNEXTMODIFIED(0)
DO WHILE lnchgrec <> 0
wait window str(lnchgrec)
go lnchgrec
lcolditem = ""
lnoldqty = 0
IF lnchgrec > 0
lcolditem = OLDVAL("polines.itemnumber")
lnoldqty = OLDVAL("polines.qtyordered")
ENDIF
lcnewitem = polines.itemnumber
lnnewqty = polines.qtyordered
llError = !TABLEUPDATE(0,.T.)
IF !llerror
thisform.removeqty(lcolditem,lnoldqty)
thisform.addqty(lcnewitem,lnnewqty)
ENDIF
lnchgrec = GETNEXTMODIFIED(lnchgrec)
ENDDO
SET FILTER TO
***************************
Bruce Gilmour

"Two things are infinite, the Universe and human stupidity. And I am not sure about the Universe."
- Albert Einstein
Previous
Reply
Map
View

Click here to load this message in the networking platform