Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETNEXTMODIFIED() detect add new rec
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01172021
Message ID:
01172029
Views:
12
>>Does anyone know if GETNEXTMODIFIED() detects the addition of (maybe several) records to a buffered table, obviously, before TableUpdate() is issued?
>>
>>The new records will have had fields filled in before saving.
>>
>>'ppreciate it
>>
>>Terry
>
>Yes:
>
>CLEAR
>CREATE CURSOR crsTest (Fld1 I)
>FOR asd = 1 TO 20
>    INSERT INTO crsTest VALUES (asd)
>NEXT
>GO TOP
>CURSORSETPROP("Buffering",5)
>? [No changes],GETNEXTMODIFIED(0)
>15
>REPLACE Fld1 WITH 77
>GO TOP
>? [Record 15 is changed],GETNEXTMODIFIED(0)
>TABLEREVERT(.t.)
>GO TOP
>? [Reverted table],GETNEXTMODIFIED(0)
>13
>REPLACE Fld1 WITH 77
>APPEND BLANK
>GO TOP
>ln = GETNEXTMODIFIED(0)
>SCAN WHILE ln # 0
>     ? [Record ]+TRANSFORM(ln)+[ is changed],ln
>     ln = GETNEXTMODIFIED(ln)
>ENDSCAN
>USE IN crsTest
>
Hi BB, old mate

Thanks. Yes I was doing some experimention myself along the lines of my scenario:

I have free tables, belonging to an FPD system, so I can't use trans .. end trans. In one I create a new rec, then there may need to be up to 3 other recs associated with it. I want to pass this table to my GP "save" class, which uses GetNextMod().

Now I manually append 3 new recs, issue x = GetNextMod(), which returns -1, naturally (the other 2 new recs' temp. nos. are -2 and -3). I GOTO x, which takes me to the 1st of the 3 new recs (-1). I alter a field and issue
x = GetNextMod() again. It returns -1 and I'm still on the same record. No matter how many new recs I ammend it always returns -1.

Now if I were to tableu() THEN alter the fields, I'm sure GetNextMod() would return each amended new rec's official recno().

So, in essence, I need to create a series of new recs and save them all at the same time, as they're all assoc. with each other. But I don't think my save class was built for this scenario.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform