-
Notifications
You must be signed in to change notification settings - Fork 1
07 Execute code
Code can be executed via the F2 keyboard shortcut. This executes the current procedure with _progres -b
, and with the propath and set of database connections configured for the project. This may not be very useful in the context of real application, especially when a different set of database connections is required, or specific startup parameters. VS Code has the ability to configure external tasks, and store them as JSON so they can be stored in the code repository and shared with all the developers. Full documentation can be found here: https://code.visualstudio.com/docs/editor/tasks
ℹ️ Ctrl + 1 in VSCode puts the focus back to the editor (if the focus was on the output view for example).
Create a file .vscode/tasks.json
in the project:
{
"version": "2.0.0",
"tasks": [
{
"label": "My TTY Application",
"type": "process",
"command": "/path/to/nowhere",
"args": [
"-basekey",
"INI",
"-ininame",
"conf/empty.ini",
"-db",
"sports2000",
"-H",
"localhost",
"-S",
"12345",
"-cpinternal",
"iso8859-15",
"-p",
"test2.p"
],
"windows": {
"command": "C:\\Progress\\OpenEdge-12.7\\bin\\_progres.exe"
},
"presentation": {
"reveal": "silent",
"panel": "new",
"focus": true
},
"options": {
"env": {
"DLC": "C:\\Progress\\OpenEdge-12.7",
"PROPATH": "target/build,C:\\Progress\\OpenEdge-12.7\\tty\\netlib\\openedge.net.pl,C:\\Progress\\OpenEdge-12.7\\tty\\openedge.core.pl"
}
},
"problemMatcher": []
}
]
}
Open a Proenv in the terminal tab, then go to the C:\Workshop\db directory and execute startDb.bat
. You should have a database broker running on port 12345.
It is then possible to execute tasks from the Terminal menu, then "Run task". Select the task you want to execute (there's only one at this stage) ; a new terminal will be opened with your _progres application.
If you remove the quit
statement from test2.p and execute again the same task, you'll end up in the Procedure Editor (as if that was started from the command line).
Add this section to .vscode/tasks.json:
{
"label": "My GUI Application",
"type": "process",
"command": "/path/to/nowhere",
"args": [
"-basekey",
"INI",
"-ininame",
"conf/gui.ini",
"-db",
"sports2000",
"-H",
"localhost",
"-S",
"12345",
"-cpinternal",
"iso8859-15",
"-p",
"test2.p",
"-nosplash"
],
"windows": {
"command": "C:\\Progress\\OpenEdge-12.7\\bin\\prowin.exe"
},
"presentation": {
"reveal": "silent",
"panel": "new",
"focus": true
},
"options": {
"env": {
"DLC": "C:\\Progress\\OpenEdge-12.7"
}
},
"problemMatcher": []
}
Then execute the GUI application with the same shortcut as the TTY application.