Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function for checking for changes in a writable cursor
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00524334
Message ID:
00524714
Views:
20
>>>>>If I have a cursor, let's call it sklcurs, and the fields are bound to a number of controls on a form, is there a way to know if as few as one field's value has changed as a result of changing it in the form control it's bound to without writing a piece of code to each control?
>>>>>
>>>>>thanks in advance for the suggestions.
>>>>>
>>>>>JE
>>>>
>>>>If you're using a buffered table, compare the current field value to the OLDVAL().
>>>
>>>Rereading your request, perhaps GETFLDSTATE() is more appropriate
>>>
>>>
>>>IF "2" $ GETFLDSTATE(-1,"sklcurs")
>>>  At Least One Field Has Changed
>>>ENDIF
>>>
>>>
>>>If you're looking at a new record, you'll look for a "4" in GETFLDSTATE(-1,"sklcurs")
>>
>>Just look for the existence of anything other than 1.
>>
>>!empty(chrtran(getfldstate(-1,"sklcurs"),"1","")) && return if existing record was modified/deleted or new record added
>
>Good idea, but since he's only looking for fields that have changed...
>
>!empty(chrtran(getfldstate(-1,"sklcurs"),"13",""))

Thank you Brien and Larry for the assistance. Brian was right that I am not looking for any added records, but I appreciate the effort on Larry's part to consider that as well, as that might be a difference in future efforts.

The code Brien posted works perfectly for what I'm looking for.

regards,

JE
Previous
Reply
Map
View

Click here to load this message in the networking platform