Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timer w/menu problems
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00466034
Message ID:
00466144
Views:
10
Hi, Randy.

There are a few possibilities of running into trouble with this setup.

First, having two timer activated at the same time could lead to one of them firing when the other one is executing, thus its processes interfer each other.

You can try disabling both timers at the beginning of each Timer() event, and enabling them again at the end, or using some kind of flag to wait when the other one is executing. I don't like very much this situation as it is higly coupled and it breaks my idea of encapsulation.

My best approach would be to use just ONE timer with the minimum interval, and fire different processes based on the given schedule. That way you can be sure that processes don't overlap.

Anyway, you can check also if you are not running in datasession troubles.

Hopes this give you at least some field for research.

Good luck!


>I have a project with a form and a menu. The menu is the 'main' object. When the exe is ran, the menu displays and the executes a 'do form formname noshow'.
>
>In the form exists nothing but two timers. The interval is every few seconds, but is a user defined preference set in the init event of each timer. The code on the timer event for these timers appears below.
>
>My problem is this. Several applications run off the menu, and in the middle of them I receive such errors as 'File is in use.' and 'Alias aimsg2 does not exist.' The most notable part of this is that it only happens when there is a volume of users. Just testing locally with two to three instances of the application, I cannot reproduce these errors. I have disabled the timers, and these problems no longer occur, so it has to exist somewhere in this code, and I don't know much about timers and how they operate relative to other objects.
Previous
Reply
Map
View

Click here to load this message in the networking platform