Had a quick play with this last night. I have a customer DBF with account, name 
and creditlim fields. So this program will list the table out, and then update 
one of the records. As you can see it is very recognisable to a VFP person, 
even though you would be able to do several things more concisely in VFP.

using system
using system.collections.generic
using system.linq
using system.text

function start() as void strict

 // -- 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

 // -- Sets the controlling index tag.
 set order to "account"

 // -- List out the table. 
 scan
 ? account, name, creditlim
 endscan

 // -- Locate a record using the order set above. 
 seek "ADA0001"
 if found()

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

 endif 

 ? "Account ADA0001 credit limit now: " + str(creditlim)

 wait

return



-- 
 Alan Bourke
 alanpbourke (at) fastmail (dot) fm



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
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