Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug on timer, but not deterministic
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00840948
Message ID:
00841533
Views:
18
Hi George,

i donnot understood why you focus attention on small Interval
( i set small only for speed up the repro code );
it does not have some importance.

For your info, minimum Interval on XP is 1ms.

Hovewer, with 1000ms the bug it remains:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	DataSession = 2
	Caption = "Form1"
	Name = "FORM1"

	ADD OBJECT timer1 AS timer WITH ;
		Top = 11, ;
		Left = 21, ;
		Height = 23, ;
		Width = 23, ;
		Enabled = .F., ;
		Interval = 1000, ;
		Name = "Timer1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 10, ;
		Left = 66, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "TRY", ;
		Name = "Command1"

	PROCEDURE giro
                * delay process
		FOR hj=1 TO 10
		NEXT
		RETURN 45
	ENDPROC

	PROCEDURE Load
		CREATE CURSOR t1 (f1 I)
		FOR k=1 TO 500000
		   INSERT INTO t1  VALUES (1)
		NEXT
	ENDPROC


	PROCEDURE timer1.Timer
          this.reset
	  ? "timer",SECONDS(),this.enabled
	ENDPROC

	PROCEDURE command1.Click
		thisform.Cls
		thisform.timer1.reset
		thisform.timer1.enabled = .T.
		? "start update"
		UPDATE t1 SET f1=f1+thisform.giro()
		? "end update"
                * NOW i stop the timer
		thisform.timer1.enabled = .F.
		thisform.timer1.reset
		REPLACE ALL f1 WITH f1+thisform.giro() IN T1
		? "end REPLACE"
		* NOW QUEUED timer events is fired !!!
	ENDPROC

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform