Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VMP form method .IsBufferDirty() code
Message
De
05/09/2018 16:10:00
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
VMP form method .IsBufferDirty() code
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01661838
Message ID:
01661838
Vues:
54
To all VMP users (Mike Yearwood for one):

Maybe you can explain this code to me (snippet only, full code in frmData/.IsBufferDirty()):
* Try GetFldState() first, which works on row buffering, 
* and on table buffering, but only for the current RECNO()

IF NOT EOF(m.lcAlias)
  LOCAL lcGetFldState
  lcGetFldState = GETFLDSTATE(-1, m.lcAlias)
  IF ('2' $ SUBSTRC(m.lcGetFldState, 2)) OR INLIST(m.lcGetFldState, '2', '3', '4')
    RETURN .T.
  ENDIF

ENDIF
If I read this correctly, if you get this far in the code, you are NOT on an appended record and the IF statement reads like this:

IF "2" contained in the lcGetFldState string skipping the deleted flag or

IF lcGetFldState is a 2 or 3 or 4...

then there is a change in the buffer.

I stumbled at using INLIST() because it only works accurately if SET EXACT is OFF (which it is in the app by default it seems). And if we have already checked for an appended record earlier, why check for the existance of 3 or 4?

Either I don't understand the code or it is really old and should have been updated.

Thanks for any insights.

Albert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform