Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Examine Changes
Message
De
19/08/2009 11:42:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/08/2009 11:37:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01418972
Message ID:
01418990
Vues:
49
>>Hi everybody,
>>
>>Does someone has a code snippet ready to get all changed fields from GetFldState + what the difference is (original value / new value). Just looking for already written code, I guess.
>>
>>Thanks.
>
>UT Magazine, May 2003, A Basic Audit Trail

The snippet that loops through actual changes (for the "update" case, as opposed to new records or deleted records) is this one:
lcChanges = ""
  for lnField = 1 to fcount()
    lcFieldName = field(lnField)
    lcChanges = lcChanges + lcFieldName + ": ";
      + transform(oldval(lcFieldName)) + " -> ";
      + transform(eval(lcFieldName));
      + chr(13) + chr(10)
  next
Come to think of it, this one seems to be missing instructions to compare whether there was an actual change in each specific field.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform