Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 and Excel
Message
From
18/11/2003 06:44:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00806542
Message ID:
00850922
Views:
30
>Cetin
>
>I have put a timer control on the form. Could you give me an example of how you fire it up and the code you would use - I have never used a timer at all
>
>Thanks for your help
>
>
>Colin

A timer will repeat execution at specified intervals.

The most important PEM for a Timer object are:

.Enabled: Set this to .T. if you want to use the Timer, or to .F. to disable it.

.Interval: For example, set this to 5000 to check every 5 seconds. (The time is specified in miliseconds.)

Timer() Event: Here you put the code that will get executed, for instance, every 5 seconds.


I think Çetin meant to use LLFF (fopen(), etc.) to check whether you can access the file.

I think this would be more or less like this:
* If you can obtain R/W access to a file, delete it
local lnMyFile
lnMyFile = fopen("MyExcelFile.xls", 2)
if lnMyFile > 0
  fclose(lnMyFile)
  erase MyExcelFile.xls
endif
Of course, instead of putting all the code into the Timer event, the Timer event can simply call a form method, or a procedure in another PRG.
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
Next
Reply
Map
View

Click here to load this message in the networking platform