Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with an automated application
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00744771
Message ID:
00744798
Vues:
35
>In this case, will have to have a class that uses a timer, that periodically checks for the existence of a file at a specific location.
>
>And do I have to have an instance of the class on every from in my application? I am just trying to think how I can work on this. Will Form - Activate be a good place to have this code?

No need for all that. You should only have 1 timer for this. YOu can establish it in your MAIN prg with you global application object [goApp]:
goApp = NEWOBJECT('custom')  && instanciate your goApp object here
goApp.AddProperty('oAppTimer')
goApp.oAppTimer = NEWOBJECT('_AppTimer', 'AppTimer.prg')
goApp.oAppTimer.Release()
**** Code for the AppTimer.PRG file ****
DEFINE CLASS _AppTimer AS Timer

	PROCEDURE Init
		THIS.Interval=300000  && this is equal to 5 minutes
		THIS.Enabled=.t.
	ENDPROC
	PROCEDURE Release
		RELEASE THIS
	ENDPROC
	PROCEDURE Timer
		WAIT WINDOW 'Fired...' TIMEOUT 1
		*!* put your file check code here and remove wait window
	ENDPROC
ENDDEFINE
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform