This morning I've been doing some refactoring (I use that term loosely) and listening to some guys talk in one of the rooms at Virtual Fox Fest. I'm splitting long lines and cleaning up comments, etc in vscode then switching over to VFP (Version 6 still I am ashamed to say) and compiling the prg to make sure I'm not getting any errors. I was thinking it would be convenient if I could make VFP compile the file I'm working on when I save it and then maybe have something look for ERR files to show up and send me a notification if it does. Does anyone have any experience doing something like this? I'd be willing to put some time into the tooling to do this. Seems like it is possible. I do realize I'd get a little more syntax checking with VFP6 and a lot more with VFP9, but I am more used to the text manipulation in vscode. Maybe I am just dreaming!
There are two ways to make that happen from what I recall. You can automate VFP with COM.
You can use a config.fpw and launch VFP with the -C "path\config.fpw" The config.fpw needs to have a COMMAND for what you want to do. It could be the COMPILE command or a PRG you want to run.
I have used both, but prefer the config.fpw method.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Jeff Roberts Sent: Tuesday, October 25, 2022 10:17 AM To: profoxtech@leafe.com Subject: dreaming of vfp and vscode integration
This morning I've been doing some refactoring (I use that term loosely) and listening to some guys talk in one of the rooms at Virtual Fox Fest. I'm splitting long lines and cleaning up comments, etc in vscode then switching over to VFP (Version 6 still I am ashamed to say) and compiling the prg to make sure I'm not getting any errors. I was thinking it would be convenient if I could make VFP compile the file I'm working on when I save it and then maybe have something look for ERR files to show up and send me a notification if it does. Does anyone have any experience doing something like this? I'd be willing to put some time into the tooling to do this. Seems like it is possible. I do realize I'd get a little more syntax checking with VFP6 and a lot more with VFP9, but I am more used to the text manipulation in vscode. Maybe I am just dreaming!
Jeff
I had a play around with this last year.
It involved creating a VS Code build task, which in turn ran a VBScript (.vbs) script. The script took the .PRG filename as an argument and created a VFP COM object, then told that to compile the .PRG.
Given the above and the Visual FoxPro syntax highlighting plugin for VS Code, it worked well enough for individual files. However it didn't help with code in visual elements like form classes and that's the show-stopper with trying to use external editors with VFP.
Hi Jeff,
Did you check out Joel Leach's DevOps https://virtualfoxfest.com/Sessions.aspx#DevOps_with_Visual_FoxPro session? It's not exactly on this topic but he incorporated external builds into his DevOps and that part might be useful.
Eric
On Tue, Oct 25, 2022 at 9:16 AM Jeff Roberts jefflroberts@gmail.com wrote:
This morning I've been doing some refactoring (I use that term loosely) and listening to some guys talk in one of the rooms at Virtual Fox Fest. I'm splitting long lines and cleaning up comments, etc in vscode then switching over to VFP (Version 6 still I am ashamed to say) and compiling the prg to make sure I'm not getting any errors. I was thinking it would be convenient if I could make VFP compile the file I'm working on when I save it and then maybe have something look for ERR files to show up and send me a notification if it does. Does anyone have any experience doing something like this? I'd be willing to put some time into the tooling to do this. Seems like it is possible. I do realize I'd get a little more syntax checking with VFP6 and a lot more with VFP9, but I am more used to the text manipulation in vscode. Maybe I am just dreaming!
-- Jeff Roberts | jefflroberts@gmail.com
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]