I have a strange network problem. I use in my program a nummeric field with contain a number.
Each time something is update in the program I increase this value.
In my program I have a timer that check the value. If it has been change, something must be done.
The problem is now that only the program that increase the value see the value-change. The other PC still show the old value.
I have make a sample-code so you can test this. I show every 10seconds the value + time() in the title of the dialog.
You can see the timer is executed, because the time change. The only thing that is not changing is the value...
To test this, hou have to run it on a network on 2 PC's. If you press 'Add' the value is changed, but only on that PC, not on the other.
What can be the problem? I do a commit after increasing the value.
- Code: Select all Expand view RUN
#INCLUDE "FiveWin.ch"
static sDlg
FUNCTION test()
local oWnd
local vstruct:={}
IF !file('refresh.dbf')
aadd(vstruct,{'NR','N',10,0})
dbcreate('refresh',vstruct)
ENDIF
use refresh new shared
IF reccount()= 0
appe blank
unlock
ENDIF
DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 TITLE "Test"
ACTIVATE WINDOW oWnd MAXIMIZED on init test_()
RETURN nil
FUNCTION test_()
local oBtn ,oTim
Define Timer oTim Interval 10000 Action chkrefresh()
activate timer oTim
DEFINE DIALOG sDlg FROM 5, 5 TO 15, 40 TITLE "Test"
@ 3, 4 BUTTON "&Add" OF sDlg SIZE 40, 12 ACTION telop()
@ 3, 12 BUTTON "&Exit" OF sDlg SIZE 40, 12 ACTION sDlg:End()
ACTIVATE DIALOG sDlg
release timer oTim
RETURN nil
FUNCTION telop()
sele refresh
IF rlock()
repl nr with nr+1
unlock
ENDIF
dbcommit()
RETURN nil
FUNCTION chkrefresh()
sDlg:Settext(str(refresh->nr)+' '+time())
RETURN nil
Thanks,
Marc