Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timers Won't Fire

Status
Not open for further replies.

wwopp

IS-IT--Management
Dec 13, 2001
5
US
I have a VFP7.0 Sp1 exe which starts by instantiating 3 timers in _screen, Simple stuff - one just shows the current time:

***

nTime3Int = 1000

_SCREEN.ADDOBJECT('currevent','eventlab')
_screen.currevent.top = 10
_Screen.AddObject('Timer3','myTimer3')
_screen.timer3.interval = nTime3Int
_screen.timer3.enabled = .t.

_screen.currevent.visible = .t.

DEFINE CLASS myTimer3 as Timer
PROCEDURE Timer
_screen.currevent.caption = ttoc(datetime())
ENDPROC
ENDDEFINE

DEFINE CLASS eventlab AS Label
Caption = ""
Left = 50
Top = 20
width = 370
fontbold=.t.
fontsize=8
backstyle = 0
ENDDEFINE

***
Two other timers perform different functions.

On a dozen Win2000 SP3 machines, everything works perfectly. On another, the NONE of the timers fire UNLESS you jiggle the main window or click the menu bar!

Any ideas why and how to solve? My user can't sit there jiggling the window all day!

Thanks

William
 
Hi,

You can avoid the timer event load.. by using..

SET CLOCK ON && to enable display of clock.
SET CLOCK STATUS && to display in status bar
SET CLOCK TO && to display at top right corner of Screen
SET CLOCK TO nRow,nCol

Date is a more constant information and can be displayed at a place whenever user starts the application.

While the above is a simple approach, having a timer class and showing Date, time, etc info can be nice provided the applications resorces are not that demanding.

I would suggest again, to combine the timer events, if possible so that the purpose is achieved while the load is reduced. It is possible to set the timer event to execute conditionaly codes based on lapsed time and so different timed events can be executed from a sigle timer event.

I am doing it in my applications.. for help bubbles, internal message events and forcing users to log out using timer class etc under one timer event.

:)

:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
I had a similar problem with timers not firing in an abstract class I was working with a while back. The only workaround I could find was to make sure some sort of event loop was in place. Instantiating a non-modal form and issuing a READ EVENTS got all the timers firing. I'm working in VFP 7.0 SP1 also.
 
Thanks to both of you for the suggestions; however, the timers are not there principally to display the time - they are there to fire certain events based on a table of schedules.

I tried placing the timers on a modal form, calling the form, then read events, but no joy....Any other ideas?

By the way, I could cause the timer to do a "fastdoevents" which is a mouse click or spacebar as appropriate followed by a doevents, but that creates a lot of havoc with other apps and doevents is problematical in VFP 7.0 as well...
 
I don't understand the line _screen.timer3.enabled = .t.
I'm thinking that timers are enabled by default and that it is the setting of interval that actually starts the timer even firing...

also, your line about a "fastdoevents" has me a little confused...where are you putting this DOEVENTS line in your code and what has it to do with the mouse click or the spacebar?

Since the application runs perfectly fine on the other Win2k boxes I would surmize that it is something that is different about that machine or something that is wrong with it. Could be the Os or could be something wrong with the installation of your application. I would start to figure out what is different about that one machine than the others where your application is running fine. This will inevitably lead to either a fix or appropriate workaround for the problem at hand.

Seems that without that extra scrutiny of the machine and install compared with the other machines/installs that you may find a way to fix the problem but then not know the cause of it, so you would be in danger of having problems with future installs and machines as well. (I guess an argument could be made that if you/we can figure out a fix it may point us to the root cause, but seems too much like guessing for my taste).

I'm sorry that I haven't a solution for you, but maybe a different approach that will result in a solution. If all else fails tell the user it's a FEATURE not a BUG. :)

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top