Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer - How to
Message
De
13/10/2000 09:56:00
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00428999
Message ID:
00429029
Vues:
27
>The best way is to make new class based on timer. Than add it in run-time to any object that is global and exists all the time application runs. In your case this may be main top-level form. If modal form opened - this is not a problem, timer event will fire anyway.
>
>Than, in your class in timer event check datetime() and shutdown application. Be sure no errors during forcing of form close, and no 'table open' dialog boxes appear because thay will prevent automatic shutdown requiring user interaction. When some form have data unsaved, that form should not show dialog boxes, so you will need a way to indicate that you're in shutdown mode. I usually use global logical variable flag for that. When it is .T., I avoid any dialog boxes and revert any changes in tables.
>
>Only cases when timer event will not fire - Windows Open dialog boxes (like file selection by GetFile(), color selection by GetColor, diirecory selection by GetDir() etc.) It aso will not work whan application hangs up.
>

It also won't fire if the VFP menu or a popup is active, or if VFP is running a tight loop with no UI interaction within a single procedure or method. It also will not interrupt a single long running SQL statement. The timer will fire (repeatedly) in these circumstances, and timer messages will queue up until VFP changes procedures or runs a UI statement that allows it to check the message queues.

Bela Bodecs has a file in the Files section that is less vulnerable to having the event not detected where you anticipate these types of programming conditions.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform