Hi Alan,

Well done and thanks for the testing work you doing.

Hmm not sure about VFP recognizable, it looks quite X# to me... :-P

Will just bash your code a little bit:

On 2019/10/23 11:08, Alan Bourke wrote:
  // -- This opens customers.dbf in the next empty work area, and specifies the 
CDX file to use.
  use "customers.dbf" new shared index "customers"
  select customers

  // -- It doesn't seem to allow updating a record without an rlock()
  if rlock()
  replace creditlim with 1000
  unlock
  endif

<bashmode:ON>
You need the RLock() (record lock) function due to shared mode. You can have multiple users trying to update the same record concurrently.  If you opened the DBF in EXCLUSIVE mode, it would not be required.
<bashmode:OFF>

Once you understand the functional/class handling way of DBF interfacing, you can shorten this code too.  Look in the help file for DbServer etc.  There are very few X# users that still do command based coding.

Another tip.  If you set the commandline switch /ppo to be included in the compilation, you will see in the .prg folder a .ppo file created.  If you open this you will see what the pre-processor did to your code to make the compiler understand your VFP XBase commands.

Johan

PS: By the way, are you using Visual Studio or XIDE for this work?


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to