What is BECOM

BECOM - BEtter COde Maker - is a group of programs written on P4GL and available in source-codes, which suppose to make your P4GL code looking better, more clear, readable and understandable. It has several different groups of modules - main modules group (common for everyone and everywhere), rules group (actual programs modifying the source code), and setup group (becom.ini file).

BECOM is an open to expand/update its functionality program. You can do it modifying/adding files of the rules group and reconfiguring the becom.ini file.

Any feedback is welcome: ysetko@progress-plus.com

What Can It Do

(and changes history)

v.1.03.04, Nov 12, 2003

v.1.03.03, Oct 02, 2003

v.1.03.02, Jul 21, 2003

v.1.03.01, Apr 01, 2003

v1.03.00, Mar 30, 2003:

v1.02.02, Feb 10, 2003:

v1.02.01, Jan 20, 2003:

v1.02.00, Jan 16, 2003:

v1.01.01, Dec 09, 2002:

v1.01.00, Dec 06, 2002:

Initial Version v1.00.00, Dec 04, 2002:

Features

Splits line containing more than one statement:
MESSAGE “a”. RETURN.        
will be:
MESSAGE “a”.
RETURN.
       
changes P4GL statements case to upper-case or to the lower-case:
Define Variable a as int.        
will be:
DEFINE VARIABLE a AS INTEGER.
or:
define variable a as integer.
       
adds/removes spaces before/after brackets ( ) [ ] and commas
cStr = getStr(sourceStr,iParam[i], getNextLineNum(iLineNum)).
      
will be: cStr = getStr( sourceStr, iParam[ i ], getNextLineNum( iLineNum ) ).
replaces short keywords by its full name:
def var a as int.        
will be:
DEFINE VARIABLE a AS INTEGER.
       
aligns source-code blocks:
DO WHILE i < 10:
i = i + 1.
END. will be:
DO WHILE i < 10:
i = i + 1.
END.
aligns IF/THEN/ELSE statements:
IF YES THEN DO:
  MESSAGE "a".
END. ELSE
  IF YES THEN MESSAGE "b". ELSE MESSAGE "c".
IF NOT YES AND NOT NO THEN MESSAGE "d". ELSE MESSAGE "e". will be:
IF YES THEN
DO:
MESSAGE "a".
END.
ELSE
IF YES THEN
MESSAGE "b".
ELSE
MESSAGE "c".
IF NOT YES AND NOT NO THEN
MESSAGE "d".
ELSE
MESSAGE "e".
aligns data definition code sections:
def input param s-value as char no-undo.
def input-output param err-msg as char no-undo.
def output param ferr as log.
will be:
DEFINE INPUT PARAMETER s-value AS CHARACTER NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER err-msg AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER ferr AS LOG.
splits long source-code lines into the several short lines:
run CheckField(buffer xattr,if wh:screen-value = "?" then "" else wh:screen-value,input-output err-msg,output ferr).
      
will be:
RUN CheckField( BUFFER xattr, IF wh:SCREEN-VALUE = "?" THEN "" ELSE
wh:SCREEN-VALUE, INPUT-OUTPUT err-msg, OUTPUT ferr ).
removes pseudocomments from the source-code:
{{&postfind}{&*} &norepaint=/*} 
will be:
{{&postfind}{&*} &norepaint=”/*”}
       
adds NO-UNDO to DEFINE VARIABLE and DEFINE PARAMETER statements:
This code:
DEFINE INPUT PARAMETER cMode AS CHARACTER. 
DEFINE VARIABLE lAddNO-UNDO AS LOGICAL INIT TRUE.
DEFINE VARIABLE cCodeCase AS CHARACTER.
DEFINE VARIABLE cmyUndoVariable AS CHARACTER. /* SKIP-NO-UNDO */


will be replaced by:      


DEFINE INPUT PARAMETER cMode    AS CHARACTER NO-UNDO.
DEFINE VARIABLE lAddNO-UNDO     AS LOGICAL   NO-UNDO INITIAL TRUE.
DEFINE VARIABLE cCodeCase       AS CHARACTER NO-UNDO.
DEFINE VARIABLE cmyUndoVariable AS CHARACTER. /* SKIP-NO-UNDO */

 

BECOM Installation Instruction

  1. Unzip the BECOM.zip into any directory included into your PROPATH.
  2. Open BECOM directory and copy file _ADEEVNT.P into your $DLC\gui\adecomm. Compile it there.
  3. Restart your Progress AB or Procedure editor session. It's ready to use now.

How to use

Environment

Tested so far on Win NT, Win 2000, Progress v9.1.

Where to download BECOM

You can always download the latest available BECOM version from here :

http://www.progress-plus.com/dnld.htm

Subscribe also to BECOM e-mail list about the new releases, bugs reports, users' opinions etc. :

http://www.progress-plus.com/emaillists.htm

Third Parties

Since June 11, 2003 BECOM is integrated into KSV Editor and can be installed as one single pre configured package from http://www.bulklodd.ru/ksvedit/ .

Miscellaneous

Most of the BECOM source-code is formatted by BECOM.

If you have a bug fixed or a new rule written, please send me a copy of what you have done. I'll include it into the BECOM distributive along with your name as the author of the changes done.

Other Tools and Utilities from PROGRESS PLUS SOLUTIONS

PRO4m - Progress Applications/Databases Analysis and Reengeneering

ProAppmon - Progress Applications Monitoring

KTEST - Progress 4GL, Database design and many more online tests

- all available on http://www.progress-plus.com