Solved

scheduling a vfp executable

Posted on 2013-06-06
6
537 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

895 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