Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer - How to
Message
De
13/10/2000 12:48:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00428999
Message ID:
00429179
Vues:
18
Hi,

If I don't use a timer. Is there any way to update the .dbc, .dbf, .cdx 's with the app open with the files read only? I understand that pack & index commands need excl use. Can you get excl use if someone has open a DBF with Shared, Read Only, Noupdate and the kitchen sink specified?

Thanks!
Roland...
========================
>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.
>
>As you see, this task is not so easy. In one of my applications I made 'companion' Windows application, that tries to shutdown any VFP applications on computer at special time. When some application failed to shutdown because dialog boxes, that application will be killed as Windows process to free resources anyway.
>
>>I have never use a timer contol before.
>>
>>I would like to use a timer control in my app that would allow me to quit the app after say 11:30pm reguardless where in the app that the user left (when home) it on the screen.
>>
>>All files are read only (no updates allowed).
>>
>>What would be the timer control steps to accomplish this?
>>
>>Main Form is modeless rest forms modal.
>>
>>Thanks in advance!
>>Roland...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform