Solved

scheduling a vfp executable

Posted on 2013-06-06
6
552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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