Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VMP form method .IsBufferDirty() code
Message
From
05/09/2018 16:10:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
VMP form method .IsBufferDirty() code
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01661838
Message ID:
01661838
Views:
53
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
Next
Reply
Map
View

Click here to load this message in the networking platform