Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automated Tasks
Message
From
25/05/2004 19:35:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/05/2004 15:35:19
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00906260
Message ID:
00907134
Views:
14
>hi,
>
>i mean if you can put this information inside the programer you send it
>before(timer example)
>
>>if i have myfolder.last. at c:\
>>and my mean program is test1,include do form menu1.
>>and i want to run it after 2 minuts.or evry 2 minuts.

OK, this example combines the READ EVENTS with the Timer example.

Create a file main.prg, with the following contents:
* main.prg
* (put your setup commands here)
* You can include the call to a global Timer object here:
private pcMyTimer
pcMyTimer = CreateObject("MyTimer")
do main.mpr && main menu

READ EVENTS

define class MyTimer as Timer
  Interval = 10 * 1000 && 10 seconds
  Procedure Timer
    ?? chr(7)
    wait window "Hello, Mohammed" + chr(13) + chr(10) + "This is a Timer example" timeout 2
    wait clear
  Endproc
enddefine
Create an empty menu. Create a menu pad "File", with an element "Quit", that executes the command:
CLEAR EVENTS
Run the program main.prg - the timer will execute every 10 seconds.

You can return to the command window with the "File | Quit" command.

The Interval property is in milliseconds; to change the Interval to 30 seconds, for example, specify an Interval of 30 * 1000. For 20 minutes, the Interval would be 20 * 60 * 1000.

In the Timer event (procedure timer), you can put any other code which you want to execute regularly.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform