Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default values and GetFldState function
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133463
Message ID:
01133480
Views:
21
>>>GetFldState(-1), first byte:
>>>3 Field in an appended record has not been modified or deletion status has not changed for the appended record.
>>>
>>>IF LEFT(GetFldState(-1),1) == [3] AND ;
>>>   NOT [4] $ SUBSTR(GetFldState(-1),2)
>>>  ** Nothing changed in this record
>>>ENDIF
>>>
>>
>>In my case there is 4 in the iActive_Flag field, though I didn't touch the record at all. This is the default value.
>
>Skip it. Check other field.
>Or:
>
>IF LEFT(GetFldState(-1),1) == [3] AND ;
>   NOT [4] $ SUBSTR(GetFldState(-1),2)
>   ** Nothing changed in this record
>ELSE
>   LOCAL lcFldStatStr, lcDefault, lnbFieldNo, lbSomethigIsChanged
>   lcFldStatStr = SUBSTR(GetFldState(-1),2)
>   lnbFieldNo   = 1
>   DO WHILE NOT EMPTY(lcFldStatStr)
>      IF LEFT(lcFldStatStr,1) == [4]
>         IF DBGETPROP(FIELD(lnbFieldNo),[DefaultValue]) # TRANSFORM(EVAL(FIELD(lnbFieldNo)))
>            lbSomethigIsChanged = .t.
>            EXIT
>         ENDIF
>      ENDIF
>      lcFldStatStr = SUBSTR(llcFldStatStr,2)
>   ENDDO
>   IF lbSomethigIsChanged
>      ** Somethig is changed for this field
>   ENDIF
>ENDIF
>
>Something like that, but not tested.

Yes, I was thinking about something like that too, but unfortunately it's a framework unsubclassed class and I really don't want to change framework classes. I changed the particular form where I found the problem and decided to leave other cases unfixed.
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