Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_Tally and timers
Message
From
09/03/2006 12:23:34
 
 
To
09/03/2006 11:53:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01102133
Message ID:
01102810
Views:
22
>>>Hi,
>>>
>>>>This *was* my understanding about timers: A timer does not fire during a SELECT-SQL and a next line that tests for the _TALLY. It only fires on moments that an input (most notably from a user) is possible.
>>>>
>>>>As a consequence of that understanding, there is *no* need to save/restore _TALLY in the timer event's code.
>>>>
>>>>This is about to become my understanding about timers: If _vfp.autoyield=.T. a timer can also fire after a SELECT-SQL and before the next line that tests for the _TALLY.
>>>>
>>>>As a consequence of that understanding, there *is* a need to save/restore _TALLY in the timer event's code.
>>>>
>>>>I'm now searching affirmation of my new understanding here.
>>>
>>>Well here's a crude test:
>>>
>>>DEFINE CLASS form1 AS form
>>>
>>>
>>>	Top = 0
>>>	Left = 0
>>>	DoCreate = .T.
>>>	Caption = "Form1"
>>>	Name = "Form1"
>>>
>>>
>>>	ADD OBJECT timer1 AS timer WITH ;
>>>		Top = 24, ;
>>>		Left = 36, ;
>>>		Height = 37, ;
>>>		Width = 61, ;
>>>		Name = "Timer1"
>>>
>>>
>>>	ADD OBJECT command1 AS commandbutton WITH ;
>>>		Top = 36, ;
>>>		Left = 204, ;
>>>		Height = 37, ;
>>>		Width = 73, ;
>>>		Caption = "Command1", ;
>>>		Name = "Command1"
>>>
>>>
>>>	PROCEDURE timer1.Timer
>>>		this.Enabled = .F.
>>>		SELECT id FROM Table1 WHERE id <> 1 INTO CURSOR j
>>>                * _tally: 50
>>>		this.Enabled = .T.
>>>	ENDPROC
>>>
>>>
>>>	PROCEDURE command1.Click
>>>		Application.AutoYield = .T.
>>>		thisform.timer1.Interval = 100
>>>		thisform.timer1.Enabled = .T.
>>>		FOR x = 1 TO 100000
>>>		  SELECT id FROM Table1 WHERE id = 1 INTO CURSOR viv
>>>                  * _tally: 1
>>>		  DOEVENTS   && No problem if this is not here
>>>		  IF _tally <> 1
>>>		    SET STEP ON
>>>		  ENDIF
>>>		ENDFOR
>>>		=MESSAGEBOX("Done")
>>>	ENDPROC
>>>	
>>>ENDDEFINE
>>>
>>>Only fails if the 'DOEVENTS' is immediately after the 'SELECT' and AutoYield's true. Doesn't ness. prove anything tho....
>>>Regards,
>>>Viv
>>
>>I have done your test and it suggests that my *old* understanding is the correct one and Fabio's understanding is wrong! Agree?
>
>IMHO Fabio's is right.
>Cetin

Did you do Viv's test?
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform