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:
01133472
Views:
18
This message has been marked as the solution to the initial question of the thread.
>>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.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform