Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VMP form method .IsBufferDirty() code
Message
From
27/10/2018 21:44:39
 
 
To
07/09/2018 11:43:16
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
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:
01662856
Views:
44
Agreed. Just wondered if I was not understanding something!

BTW, slow reply as have been off for a bit as my wife has been closing her store the past month and so I have had to help a lot with that.

Albert

>>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
>
>Hi Albert
>
>This part means ('2' $ SUBSTRC(m.lcGetFldState, 2)) some field content had been changed, so that makes sense.
>
>From the VFP help:
>
>2 Field has been modified or deletion status has changed.
>
>3 Field in an appended record has not been modified or deletion status has not changed for the appended record.
>
>4 Field in an appended record has been modified or deletion status has changed for the appended record.
>
>SET EXACT OFF is our standard. Developer users have to set exact on where and when needed and turn it back off. So INLIST is OK here.
>
>As you said, by that point in the code, we're not on an appended buffered record. I checked and it never gets 3 or 4. The rest of it does not seem sensible to me either. I emailed Art. It appears the inlist is never fired. So while it may be incorrect, it's harmless. Agree?
Previous
Reply
Map
View

Click here to load this message in the networking platform