Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to program testing the multiuser program?
Message
From
08/11/2003 19:16:58
 
 
To
04/11/2003 11:47:54
Michale Chen
Shijiazhuang ZhiYuan Crop.
Shijiazhuang, China
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00846038
Message ID:
00847995
Views:
23
This message has been marked as the solution to the initial question of the thread.
Hi,
As mentioned by other members, you should use GETFLDSTATE() and GETNEXTMODIFIED() to detect changes on your own local buffered data. Then,
FOR I = 1 TO FCOUNT()
  lcField = FIELD(I)
  IF CURVAL(lcField) # OLDVAL(lcField)
    *--Conflict
    RETURN <ERROR>  
  ENDIF
NEXT

*-- No conflict, issue TABLEUPDATE()
IF NOT TABLEUPDATE(.T., .F.)
  AERROR(laError)
  DO CASE
  CASE laError[1] = 1585
     RETURN "CONFLICT"
  OTHERWISE
     RETURN "ERROR"
  ENDCASE
ELSE
  RETURN "OK"
ENDIF
IF, your meant is how to know your conflict handler routine works correctly? You can have two instances of VFP running at the same time in same machine, Locate same record and make changes in both instance. Then, issue TABLEUPDATE() on 1st instance, after that go to 2nd instance and issue TABLEUPDATE() again. You will found that TABLEUPDATE() return .F. with error code 1585 in 2nd instance.

HTH
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform