General information
Category:
Coding, syntax & commands
>How do you force VFP exe to behave like a console app?
>And, when you created the C# application, did you use the console app?
Yes, C# as a console app.
A lot of what I use for VFP console apps (batch programs) I learned from Rick Strahl
Thanks Rick!
I attached three files:
ConsoleLog.prg
MakeConsole.bat
Readme.txt
After you compile your VFP app
Run MakeConsole.bat to convert the exe to a console app.
For VFP:
Config.fpw as follows
SCREEN=OFF
DELETED=ON
SAFETY=OFF
RESOURCE=OFF
In your main prg:
SYS(2335, 0) && Unattended Server Mode
PRIVATE Console
Console = ConsoleLog() && Create Console once in your main
Console.Log("Starting VTC_GPS") && Console.log("Your String") will write to the console AND the log file
&& Console.log() is your friend - these apps run unattended and invisible in the task scheduler
&& Almost impossible to log too much
&& Wrap your main prg in a try/catch and Log any errors
&& and send yourself an email with the log file if you can
&& Good Luck!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only