Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timer within a timer?
Message
 
To
06/11/2001 18:46:33
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00578290
Message ID:
00578305
Views:
20
>Thanks for the reply Gerald. I am working on a program that copies files from a specified directory into a table. Every 5 seconds we check if there are appropriate files in the specified directory. (using adir command) If there is then we copy the files to the table. But before that we have to wait another 5 seconds because its possible that the file is there but it is not complete. I actually asked my boss the exact same question.
>
>For some reason, I still can't get it to work. Here is the code. If start a blank form with a timer control and put this in the timer event you'll see what I mean.
>
>
>*do some stuff
>MESSAGEBOX('before second timer')
>
>oTimer = createobject("timer")
>WITH oTimer
>	.interval = 5000
>	.enabled = .t.
>endwith
>
>MESSAGEBOX('after second timer')
>
>
>>To start the timer just enable it:
>>
>> .enabled=.T.
>>
>>But, why do you want to create a new timer
>>each time a timer event hit?


Ok, but a timer is not a "wait state" it's just a timer.
Your first timer's method continue after the creation
without waiting the firing of the second timer's timer event...

You need something like this:
*do some stuff

This.Enabled=.F.

WAIT WINDOW "I see some file and wait 5 seconds" TIMEOUT 5

This.Enabled=.T.

*do something else
HTH :-)
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform