Solved

scheduling a vfp executable

Posted on 2013-06-06
6
548 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

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…
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

730 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