Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETFLDSTATE() returns modified if no modification
Message
From
12/07/2001 21:47:39
 
 
To
12/07/2001 21:23:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00530051
Message ID:
00530059
Views:
29
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform