GWD-4GL Version 0.2

Client/server IDE/editor integration scripts for 4GL development using GWD Text editor

16/11/2002

By Andrej Falout


Please note:

This software is assembled as a "Proof of concept" , and for my personal use. It works for me. Making it work for you will require some skill and time.


Table Of Contents:

  1. Background
  2. What is it?
  3. How does it work
  4. Status
  5. Files
  6. System requirements
  7. Installation
  8. People
  9. License

1:Background

For a long time people who have courage to admit that they do not like (to say it politely) vi and commands that look like

wrex 'bljak -4//\\\@-r | "$RT" > brlj ?##*('

as a part of there daily development routine when developing 4GL applications, and accept the risk of being called incompetent, amateurs, beginners... had several problems. One was how to get there source files into some user friendly and 4GL friendly, more productive editor/IDE. Second was how to get IDE functionality for 4GL programming language in that editor/DE. Third was how to get all the actions in development cycle (compile/debug/run) still execute on the server where compiler is installed.

In most commercial development installations, 4gl compiler and database are installed on some UNIX server, and in most cases developers are provided with Windows workstations to access this server. Source files also reside on the server, shared between all developers, and under control of the versioning system.

To take file from server and open it in editor, Samba server, or any NFS client like "FTP Software's InterDrive" will do that, but how will you tell version control software like SCCS or CVS, that resides on server to let go of that file? How will you compile it, and at the end, how will you run without resorting to "green-screen"?

Pat Morita explained the problem to Ralph Machio, with wisdom, and profoundness that I cannot compete whit, so I will just quote:

"You walk left side of street. That's OK.
You walk right side of street. Also OK.
But....
You walk in the middle, Swisshhhhh, you get squashed.
You karate do, or you karate don't."

"Karate Kid III"

Don't you feel there is something wrong with developing GUI software on command line green-screen?

After seeing Jonathan Leffler's noble effort to adapt r4gl/i4gl application from RDS system to run in GUI, (http://www.informix.com/idn), I felt that even that is still to much "walking in the middle", and that it have several problems with integrating with tool that every P/A uses the most - the editor.

So I decided to move everything INSIDE the editor.

It might be interesting to note, that recently 4Js developed an interesting IDE for there version of 4GL compiler. Querix also attempted something, with less success, in my opinion. I work various 4GL compilers, so I needed one solution to support all of the tools I will use: Aubit 4GL, Informix-4GL, 4Js, Querix, Plexus.

Back to top


2:What is it?

This is a collection of C, BAT and SH scripts that can turn GWD Windows text editor (www.gwdsoft.com) into 2-tier Interactive Developer Environment.

Essentially what I did, is a combination of powerful, full featured GUI text editor that knows how to run interpreted ANSI C language inside editor, using C as his "macro" language, and added client side rsh for executing commands on server, plus rcp for copying files from/to server, and added a few shell scripts that wait on the server to do requested job, like Agents.

Since people that will use this are programmers anyway, and every 4gl environment is inherently different than the others, the fact that this package is instantly customizable to the lowest level that you can imagine thanks to its script nature (C, SH) is actually a benefit, not a limitation in my opinion, and is certainly something no IDE I have seen have.

This code can just as well operate with everything (source code, compiler) installed on the same computer - providing most is not all functions you would typically find in an IDE with support for a particular programming language. 

Back to top


3: How does it work?

You click icon, or select item from menu, or press ctrl+shift+t, in editor, and that calls specific C program.

Interpreted C program running inside editor collects necessary data form ini files and/or opens GUI dialogs, and calls BAT file

(This stage will be removed in implementation phase 2) Bat file does additional processing, and then executes RSH and/or RCP.

(This stage exists only if rsh was called) RCP passes parameters and executes shell script on server.

(This stage exists only if rsh was called) Shell script do something, and return success and other results to bat script

Bat script continues from the point where the rsh or rcp was called, do additional processing, and returns control to C script running in editor that originally called it

C script resumes from the point it called bat script, and do additional processing...

GWD editor informs you about results, opens a document, opens dialog window, etc...

It will allow you to perform full circle of usual development icicle, like Take file from version control, Copy file from server to client and open it in editor, Edit file in rich, fully configurable GUI environment, execute compile or make of sourcefile/program on server, run or run in debugger program you just compiled, and then Copy sourcefile back to server and put it back to version control system, without the need to use character terminals.

It is specially well suited for Informix Dynamic 4GL and 4Js 4GL, because they have GUI client-side presentation layers, but it is possible to use it in classic CHUI 4GL environments also (if You have Terminal emulator that can execute scripts on server on startup, like PLwin)

This scripts are VERY BETA, and are very far from being generic; they are specific to the customer site I'm currently working on, so...God help you, or you should wait another few months.

WARNING: You will have to do a lot of modifications to adjust for your environment, at this stage. You will need to know ANSI C, DOS Batch files and UNIX Shell scripting to do so. No guaranties, no promises,

Also, there is danger that your employer will say something like this, before thanking you for your services:

"If you really had xx years of 4gl experience as you said you have, you would be comfortable and happy using vi and UNIX prompt command lines, and would not be constantly trying to run away from it."

Only support that I can offer to you in relation to any of these, including all the files in this zip, is replay to that:

"If you really had your drivers license for xx years as you said you had, you would be comfortable and happy driving xx years old Ford Escort, not this brand new BMW. Liar."

("Based on the true story")

Back to top


4: Status:

Phase 1: (Proof of concept - Completed)

GWD
MACRO
MENU
ITEM
FUNCTION  c BAT sh
1 Open + + N/A
2 TakeOut + + ?
3 Compile + + +
4 Make + + +
5 Run  + + +
6 Debug + + +
7 Save + + N/A
8 PutBack + + ?
9 Configure
- Makefile/TOC open 
- Search/grep based on Makefile/Toc
+
+
?
N/A
+
?
N/A
+
+
10 YOUR IDEA HERE ? ? ?
11        

Phase 2: (In progress)

Replace batch files (.BAT) functionality with c - move all client processing into editor script, just call external rcp/rsh

Phase 3:

Replace external rcp/rsh with DLLs from http://www.denicomp.com/

Phase 4:

Provide ODBC links to database for:
"Define ... like" control
Table/field browser
Project/Application/Program repository/definition/browser
Source code repository with version control
YOUR IDEA HERE

I'm also working on 4gl code beautifiers/formatters integration with GWD (adapted versions of CodeBeuty, DbBeauty, InfmxTidy and kw from IIUG).

Back to top


5: Files

Directory Client\script\remote:

Destination:     %GWDinstalllDir%\script\remote
Contains:         C scripts

Directory Client\bat:

Destination:     %GWDinstalllDir%\bat
Contains:         Batch (BAT) scripts - Will be obsolete after conversion to c

Directory Client\I-GWD:

Contains

Destination

GWD.ini %windir%, but this is my configuration provided for your information
plwin.ini This is just example of PLwin terminal APP ini file with section of login script written directly from GWD to initiate run of CHUI mode apps
*.bmp %GWDinstalllDir%
syntax.hgl  %GWDinstalllDir%

Directory Server\GWDagents

Destination: $HOME/GWDagents (on remote UNIX server)
Contains: Shell scripts that act like agents for client side scripts

Back to top


6: System requirements:

Client :

Server:

Nothing that i can think of. Maybe Perl, but you do have this anyway, don't you? And if you have Perl, you also have Jonathan Leffler's DBD::Informix (http://www.perl.com/CPAN), don't you? (Not that you will need it for this, but...)

Back to top


7: Installation:

  1. Download and Install GWD Text editor
  2. Download and Install rsh/rcp somewhere in the path
  3. Copy files in appropriate locations, as described in "5: Files in zip". Make sure you have enough space in your client environment to accept all environment variables set by BAT programs. You can do that by inserting line

        SHELL=C:\windows\COMMAND.COM C:\ /E:1200 /P 

    in your config.sys file.
  4. Edit .rhosts file in your home directory to enable rsh/rcp access authorization. Also, check /etc/hosts.equiv and check that your client is in the DNS tables or in /etc/hosts file and that your client name is known to the server
  5. To create Macro menu entries in GWD: 

        Options->Customise Macro Menu->Add

    Enter description and select C file associated with option

    ...repeat 9 times...
  6. To create keyboard shortcuts in GWD:
    (Only necessary if you want to activate functions with keyboard shortcuts and/or icons)

        Macro->Macro->New->Entrer name and shortcut

    Enter Macro body like:

        Param1 "\\remote\\takeout"
        ExecScript


    Answer YES to "Compile?" Question
  7. To put Icons on toolbar in GWD:

        Options->customise Toolbars->Select "Script or macro 1-9"

    If you want to customize bmp pictures to be displayed for icons, put bmp files named macro1.bmp, macro2.bmp in GWD install directory. You can start playing with ones I made, in directory Client\I-GWD
  8. Select 

        Macro->"Remote Options/misc" 

    (or whatever mane you gave to config.c in step e), and select "Configure options and defaults..." from list, them answer the questions...
  9. copy sintax.hgl file from Client\I-GWD over the one that GWD installed. It contains 4gl, 5gl, SQL, sh, spl and so on syntax highlighter definitions
  10. Select 
        Options->Help Options
    and select hlp files with 4gl help files from Informix 4gl for Windows (4glref.hlp) and/or error messages help files from ROM, etc...(If you have them)
  11. Take a deep breath, and start exploring code. You will need to modify A LOT to make it run in your environment, and I suggest to start with rOpen.c / rOpen.bat (there is no rOpen.sh, no need for it) because that is the simplest pair.
  12. Email me your results, insults, ideas...
  13. I you find any good use for GWD and/or rshrcp32, please do remember that these are shareware product that need to be registered after trial period.

Back to top


8: People

After my initial idea was presented to him, original base scripts for TakeOut, PutBack and Config have been written by Vedran Gaco (gwd@iridis.com), author of GWD Editor and many other excellent shareware application (www.iridis.com/gwd).

From that point on, I have completed that and other scripts, but I continue to work closely with Vedran. Hopefully, he will do the "nasty" parts of c code to eliminate BAT scripts totally.

Have Fun!

Back to top


9: License

This software is released under GNU General public license.

Back to top


Back to top Aubit 4GL project home