Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scheduled task

Status
Not open for further replies.

JudyBarer

Programmer
Jan 13, 2004
23
US
I would like to create an app that would run once a month to run a bunch of different reports. I plan on using the Windows scheduler. Do I have to create a whole new project to create this app. ( I already have a project with all of my files for my VFP 8.0 application that my users in the office use for the main database in the office. This app would just be running reports on the same data from my main app) Can I simply create a prg file that sets the path, sets exclusive off and then runs a bunch of sql statements and report form statements. If I do need to place the prg file in a project, do I need a main.prg program with a read events or could that prg file be my main file where the app starts from? There would be on user interface.

Thanks a lot
Judith
 
JudyBarer

I use this technique many times. I use the "closest related already existing project". Create a program the does what I need, set it to "MAIN", compile it into an executable, and that is it! Put the exe in the scheduler.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
<<I use this technique many times. I use the "closest related already existing project". Create a program the does what I need, set it to "MAIN", compile it into an executable, and that is it! Put the exe in the scheduler.>>


Do you mean that even if I already have a project with a main program I could just temporarily set this prg to main do the compilation and then set the real main program back to main?

Thanks
Judy
 
Do you mean that even if I already have a project with a main program I could just temporarily set this prg to main do the compilation and then set the real main program back to main?

That is correct. Once compiled, you can reset your "other main program" back to main in case you need to recompile that one. I have one project that contains about 12 "mains" that I switch back and forth.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Swapping main is an interesting approach.

I just have my main prg check for a command line parameter. If it got a parameter (and it's the right type), I go through the motions of setting up the app's environment but instead of READ EVENTS I run whatever unattended task is supposed to run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top