Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetNextModified and GetFldState don't agree
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01222033
Message ID:
01222995
Vues:
15
>I have a situation where a client said they were getting a "save changes?" question each time they moved to a new record on the sales orders form. Turns out they weren't hallucinating (you can always hope, right?). So I traced it. Yep, GetNextModified returned 1 on the line items table (local view), yet it was definitely not modified. My framework has the ability to "check each record", which means go to the record that is supposedly modified and use GetFldState to see if it's truly modified (I wish I could remember why I added this feature - I think it was just a way for me to check which field got unintentionally modified in order to correct a bug). Anyway, GetFldState returns all 1s. Kind of strange. Don't remember seeing this before. If I leave the CheckEachField option turned on, the system correctly divines that the record is not changed and doesn't ask them to save, but I'm presently at a loss to see why this would happen. Anybody seen this one?
>
>Russell Campbell

Hi Russell,

I don't known your code,
but remember this ( a bug for me ):
On VFP9, when you use SETFLDSTATE() it set GETNEXTMODIFIED() on every case
CLEAR

CREATE CURSOR aaa (ff i)
APPEND BLANK
APPEND BLANK

CURSORSETPROP("Buffering",5)

* return 0,'11' !
? GETNEXTMODIFIED(0),RECNO(),GETFLDSTATE(-1)

* if you use SETFLDSTATE it set GETNEXTMODIFIED on every case
GO 2
=SETFLDSTATE(1,1)

* return 2 ? ,'11'
? GETNEXTMODIFIED(0),RECNO(),GETFLDSTATE(-1)

* of course you cannot reset GETNEXTMODIFIED with SETFLDSTATE
GO 2
=SETFLDSTATE(1,1)

* return 2,'11' !
? GETNEXTMODIFIED(0),RECNO(),GETFLDSTATE(-1)

GO 2
* return 2,'11' !
? GETNEXTMODIFIED(0),RECNO(),GETFLDSTATE(-1)

* TABLEREVERT reset GETNEXTMODIFIED
* TABLEREVERT(.F.)
* return 0,'11' !
? GETNEXTMODIFIED(0),RECNO(),GETFLDSTATE(-1)
Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform