Solved

scheduling a vfp executable

Posted on 2013-06-06
6
545 Views
Last Modified: 2013-06-06
Hi:
I have to run a vfp program at night. I have created an executable but it opens in the window thingy (sorry - not technical) requiring me to then open the form that runs the code. Since I am planning to be tucked up in bed this is a problem. I must be doing something wrong - but is there a way to create a standalone vfp exe that simply opens the form, with the code running at the init phase? I selected normal and top level but still get the window opening, not the form triggering.
Am I missing something here?
Thanks!
0
Comment
Question by:ClaytonGlass
  • 3
  • 3
6 Comments
 
LVL 42

Expert Comment

by:pcelba
ID: 39225103
Why do you need the form? Simply place the code into a .PRG file and set the PRG file as the main program in your Project. When you execute the EXE the main program will run immediatelly.
0
 

Author Comment

by:ClaytonGlass
ID: 39225118
That is all news to me, I am afraid. I don't know what a prg file is! Let me dig through the manuals but thanks for the prompt response
0
 
LVL 42

Accepted Solution

by:
pcelba earned 300 total points
ID: 39225139
The .PRG file is a simple text file containing code in FoxPro language and created by MODIFY COMMAND <FileName>.

You may also create the .PRG file by clicking on the New... button in Code tab of Project manager. You may start with WAIT WINDOW command and build the EXE to see the functionality.

You may also open any form from the code by:

DO FORM YourForm WITH parameter1, parameter2, ...

If you decide to execute some code in your form then do it in Init method. It can be conditionally based on the parameter passed (Init must have LPARAMETERS command at the first line). You may also setup some Timer in your form which executes the code after some delay when the form appears. Etc.  The form should be Modal in this case.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Closing Comment

by:ClaytonGlass
ID: 39225148
Brilliant answer as usual, thank you very much pcelba! I am following up as we speak, plus hacking through the manuals!
0
 

Author Comment

by:ClaytonGlass
ID: 39225160
And yes, thanks again. I can sleep peacefully now!
0
 
LVL 42

Expert Comment

by:pcelba
ID: 39225178
You are welcome!

We are rather scheduling tasks in a small VFP application than to rely on Windows... Of course, it requires to be logged in all the time but the session is running on a server so it is feassible. And such app must be restarted weekly because VFP isn't so stable as I would wish...

If you are executing the app every night by Windows Scheduler then it should also work without problems after appropriate settings.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
This article describes how to reset your Windows 10 password when you've forgotten it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question