Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GETFLDSTATE() returns modified if no modification
Message
De
12/07/2001 21:47:39
 
 
À
12/07/2001 21:23:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00530051
Message ID:
00530059
Vues:
30
>The GETFLDSTATE() function returns a status of modified when a field changes. Assuming, we have this command:
>
>
>? GETFLDSTATE(3)
>
>
>If the 3rd field is modified, the status will be 2. However, if we type the same value in the field, the status is also 2. So, a modification status is also effective. Is there a setting to avoid the status to be 2 if the value is the same as when the user accessed the table?

The only way I have succeeded in doing this is to use the OLDVAL() function.
If the values compare equal then SETFLDSTATE back to unchanged. Valid() is where I do it but LostFocus() should work too I guess.
Hacker's warns that using SETFLDSTATE() does NOT prevent an update from taking place so when it comes time to write I use GETFLDSTATE(-1) to check for any changes, reverting if there are none.

JimN

WARNING: This is where I learned the hard way that OLDVAL() returns NULL if the original was resultant from an APPEND BLANK.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform