ProED4W

Purpose of Proed4w:

If you are using "ED for Windows" (version 4) and are editing .p or .w files, you can use this tool as a communication bridge between ED for Windows and a Progress session.

You can do:
- create a "Compile" button in Ed for Windows
- compile 4GL code from within Ed
- Ed shows compile warnings and errors in its Build results window.

You can also:
Launch Prolint from within ED for Windows to have it check the current sourcefile.

The output from Prolint is displayed in the blue "Build results" window in ED for Windows, from where you can easily navigate to the matching sourcelines.

Proed4w is not exclusively designed to launch Prolint; it can also be used for syntax checking, compiling, running etc. However, the setup-instructions in the manual will focus on Prolint.


Download ProED4W

Download the progam with sources here:


ProEd4W manual

Documentation TODO: make sure to explain that this tool is not just for Prolint. The tool is also nice when you want to compile from within Ed4W and recieve the compiler warnings back in ED.

system requirements:


- Windows (any version)

- Progress version 9 (we use sockets and pub/sub)

- ED for Windows version 4

- if you want to use this tool for launching Prolint: you'll need Prolint release 26.

Purpose of Proed4w:

If you are using "ED for Windows" (version 4) and are editing .p or .w files, you can launch Prolint from within
ED for Windows to have it check the current sourcefile.

The output from Prolint is displayed in the blue "Build results" window in ED for Windows, from where you can easily
navigate to the matching sourcelines.

Proed4w is not exclusively designed to launch Prolint; it can also be used for syntax checking, compiling, running etc. However, the setup-instructions in this document will focus on Prolint.

How it works, in a nutshell:

ED for Windows is able to invoke "Build tools". Most programming languages
come with command-line tools (like make, compilers, linkers etc.) who send their output to stdout.
ED for Windows is designed to launch such command-line tools, and intercept their stdout output
to feed the "Build Output" window.


Progress does not have many command-line tools, that's where ProEd4W comes in.

Proed4w.exe is a command-line tool with output to stdout, so ED can deal with it.
Proed4w.exe cannot actually compile anything, but it forwards all requests to a Progress session where proed4w.p is running.

Proed4w.p is a persistent procedure that opens a TCP server, listening for requests from proed4w.exe.
When proed4w.p receives a request for a compilation, syntax-check or prolint-check, it just runs the
appropriate Progress tool.

Those Progress tools can PUBLISH text (like compiler warnings) to proed4w.p, who sends the text back to
proed4w.exe through the TCP connection.

Proed4w.exe simply writes any messages it receives from proed4w.p, to stdout where ED for Windows can catch it.

winEd4W.w is a little window that maintains persistence for proed4w.p. The window has a trayicon that changes color if there is an active connection. The window is minimized to the trayicon by default, but when it is restored it shows the most recent command and the current status (waiting or busy). You may find it convenient to add this window to the PRO*TOOLS palette.

Installation:

Download proed4w with sources from page: "download proed4w".

Follow the instructions on page "Setup and Configuration".

In addition you may want to fine-tune some parameters, see page "parameters".

How to use it:

Once you have followed the setup/config-instructions it should work like this:

  1. Start ED for Windows and open a 4GL sourcefile (.p or .w).
  2. If you have created a custom toolbar-button, just press it. Else choose menu "Tool|Build setup...", select "Prolint" and press the Run-button.
  3. The (blue) "Build results" pane will appear where the output from proed4w.exe will be listed.
    Proed4w will try to connect to a Progress session where proed4w.p is already running persistently.
    If it can't find such a Progress session, proed4w.exe will launch one.

  4. Prolint-results or syntax-errors will appear in the "Build results" pane until proed4w.exe is done.
    The Progress session will not quit; it will wait for future requests.

  5. You can double-click on a line in "Build results" to navigate through the source, or you may press the "previous error/next error"-buttons in the toolbar.

If you don't want ED to launch a new Progress session, you will have to make sure that proed4w.p is already running persistently in an open session:

  1. Open the PRO*Tools menu and launch the "ed4win server" tool.
  2. A new window will open but it will immediately minimize to the system tray.
  3. Right-click the tray-icon to show or stop this ed4win server or to quit the Progress session.

That's all. Enjoy!


Parameters

Basic parameters:

To start Prolint for the source you are currently editing in ED, you would set up ED to invoke proed4w.exe with the following command-line:

   d:\progresstools\proed4w\proed4w.exe -c prolint -f "<NAME>"

(the location of proed4w.exe may be different on your PC)

  • -c

    specifies the command to perform, in this case "prolint". Other values could be "syntax" or whatever we may come up with next.

  • -f

    specifies the filename to perform the command on, in this case "<NAME>"

    ED replaces <NAME> by the fully-qualified name of the current file.

Note: proed4w.exe does not actually cares about these parameters. It simply forwards them to proed4w.p, who does
parse the command-line and decides which tool to run based on the -c parameter.

Advanced parameters:

proed4w uses a TCP-connection on host 127.0.01, port 2525.

If you want a different portnumber you can specify so in file proed4w/port.i.

This file is included by proed4w.p and is imported by proed4w.exe so they are always using matching ports.
You can also override all by using parameters on the command-line:

   d:\progresstools\proed4w\proed4w.exe -H 192.168.1.3 -S 3001 -c prolint -f "<NAME>"

But of course, the owner of host 192.168.1.3 will not appreciate that :-)

Suppose there is no Progress session listening at the specified port.

Proed4w.exe can automatically launch a Progress session for you, unless you specified a
host other than 127.0.0.1.

Use the -cfg parameter:

   d:\progresstools\proed4w\proed4w.exe -cfg sports -c prolint -f "<NAME>"

This will cause proed4w.exe to attempt a connection at 127.0.0.1:2525 and when it doesn't
get such a connection, it will launch a new Progress session (identified by the -cfg parameter) and then it will retry to get a connection.


"-cfg sports" means that proed4w.exe will search for startup-instructions in file "c:\p4gl\tools\proed4w\settings\sports\proed4w.ini" to launch a new Progress session. This .ini-file should specify the commandline, parameters and working diretory for the new Progress session, there are one or two examples for such an .ini-file shipped with the initial installation of proed4w.


Setup and Configuration

This page describes the steps to configure proed4w. Don't let the amount of text on this page scare you: it really is not much work to get started.

Locate or create a directory in your PROPATH where you like to install tools, for example:

c:\p4gl\tools            (existing directory, already in your PROPATH)
c:\p4gl\tools\proparse   (contains proparse.dll and sources)
c:\p4gl\tools\prolint    (contains prolint sources)
c:\p4gl\tools\proed4w

Unzip the contents of proed4w.zip in directory tools: this will create subdirectories tools\proed4w and tools\adecomm. If all is well then you
should be able to "run proed4w\proed4w.p" without modifying the PROPATH.



Next you will have to customize a couple of configuration files. You can choose to let setup.w take care of all that, or you can choose to do it manually. I suggest you use setup.w first and maybe later optimize some things manually when needed.

Automated configuration, using setup.w:

  1. Start a Progress session and connect all databases that are required for a typical development session. More precisely: connect all databases that are required when you want Prolint to check your sourcefiles.
  2. Make sure ED for Windows is not running. Close ED if it is running.
  3. run proed4w/setup.w.

That's all! You can skip the next paragraph and continue reading "Create a custom toolbar-button in ED for Windows".

Note: You can repeatedly run setup.w, it will never override existing settings except in directory proed4w/settings/setup.

Manual configuration:

If you didn't or couldn't simply run proed4w/setup.w, you can follow these steps instead:

  1. Add proed4w/winEd4W.w to the PRO*TOOLS palette. A small bitmap is provided in the proed4w directory.
  2. procedure proed4w/winEd4w.w requires the MessageBlaster OCX. There is a chance that this OCX is already registered on your PC, but if it isn't run the following command (assuming that proed4w was installed in subdirectory c:\p4gl\tools):
    regsvr32 c:\p4gl\tools\proed4w\msgblst32.ocx
    
  3. in ED for Windows, open a .p file, then go to menu-item "Tool|Build setup..." and press the "Add"-button to add a new extension-specific program title. Give the new program a descriptive title like "Prolint". Set the command line to

    c:\p4gl\tools\proed4w\proed4w.exe -c prolint -f "<NAME>" -cfg setup
    

    (where c:\p4gl\tools\ needs to be replaced by the actual location on your PC).

    A complete overview of parameters is on page "parameters".

    Set "Error track type" to "Progress" and select "Show output window". You may also want to experiment with the radio-set "Save edited files".

    The result will look like this screenshot:

  4. now open a .w file in ED for Windows and repeat the previous step to add Prolint for this extension too.
  5. Create yet another one, but this time as a General title (not extension specific). Name it "Prolint-logwin" and the command-line is simply:
    c:\p4gl\tools\proed4w\proed4w.exe -c prolint-logwin
    
  6. locate subdirectory proed4w/settings/setup. You will find a couple of files: setup.ini, setup.pf and proed4w.ini.
    These files need to be customized:

    • proed4w.ini: modify command and workingdir
    • setup.ini: (this is basically a copy of progress/startup.ini): modify at least DLC and PROPATH
    • setup.pf: add connection parameters for your development database(s).

Create a custom toolbar-button in ED for Windows:

You don't have to create a custom toolbar-button but it makes life helluvalot easier: edit a source file, press the button and Prolint will inspect your modified source.


The steps to create a button can be found in the FAQ at getsoft: click here.