Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default values and GetFldState function
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01133463
Message ID:
01133472
Vues:
21
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform