Solved

scheduling a vfp executable

Posted on 2013-06-06
6
534 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 41

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 41

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 41

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now