Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running a VFP EXE on the VM Server
Message
From
07/09/2019 03:10:52
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01670603
Message ID:
01670671
Views:
47
>Thank you. Then the windows scheduler will be the approach (if customer approves, of course).
>
>>Been there, done that. I would second on Sergey's advice. Do not try to run a VFP service with a timer continuously. It stops working with no reason. We ended up with using windows scheduler itself (also much more flexible).

I have found the same - write a regular exe and run it in windows task scheduler works great, and a VFP program with a timer is problematic.

Just write your program as a batch - do your task and exit, no READ EVENTS.

I found writing out progress to the console and a log file to be useful.
Rick Strahl has some code on West-Wind.com how to make a console window
https://west-wind.com/wconnect/weblog/ShowEntry.blog?id=871

And be sure to use Sys(2335) to prevent dialog boxes or other UI that hangs your application. https://www.tedroche.com/hackfox7/s4g808.html

And the last catch is to use a TRY CATCH so you can trap any errors and log them and maybe attempt to email the error details to yourself.

Good Luck!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform