Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GETNEXTMODIFIED with new records
Message
De
11/06/1998 16:42:12
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
 
À
10/06/1998 17:54:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00106948
Message ID:
00107364
Vues:
31
I think you may be on to something. 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

And - no - I am adding the record directly to a buffered table.

>Are the records being directly added to a table that is buffered -or- is it possible that you're adding records to an unbuffered view? Also, you do know that record numbers for appended records in a buffered table are negative and may not be caught if you use ther default 0 for starting record number in GETNEXTMODIFIED parms.
>
>
>>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
***************************
Bruce Gilmour

"Two things are infinite, the Universe and human stupidity. And I am not sure about the Universe."
- Albert Einstein
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform