Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 9 Service app
Message
From
11/05/2021 12:55:08
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680208
Message ID:
01680309
Views:
53
Likes (1)
>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
Map
View

Click here to load this message in the networking platform