Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetNextModified and newly added record
Message
 
 
To
21/10/2002 16:25:33
Eugenio Casal
Futura Tecnologia Informação Consult Ltd
São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00713585
Message ID:
00713658
Views:
19
>Nadya,
>
>Why don´t you check the value of GETFLDSTATE(-1)?
>
>lnModified= '4' $ GETFLDSTATE(-1)
>
>
>Regards,
>
>Eugenio

I've checked help on this function and also Hacker's Guide and it seems, like it's not enough in my situation. First of all, I want to check for the status in the whole file, not just current record. Secondly, there are warnings like:


When you add a new record and it has default values set, GetFldState() returns 4 for those fields, even if the user leaves the default values alone. If your framework checks for changes in order to figure out things like whether certain buttons should be enabled or disabled, at last you have a reason to use SetFldState(). Reset the state right after the append and your other code will still behave as you expect it to.


One warning here: GetFldState() doesn't get changed for a field until you've left the control it's bound to. If you make changes but don't leave the field, causing its Valid to fire, the changes don't get sent to the control's ControlSource and GetFldState() doesn't see them. This is consistent with controls not getting their Value changed until Valid is fired.


While both seemed to be unrelevant in my case, I still can not rely on this function 100%. I think, my own solution gives me more control, though it's not the cleanest solution, since it requires class change and form's code change as well.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform