Indent Free-RPG program

page d'accueil
Boite à outils

Cette page a été mise à jour le 14 septembre 2009
Contact

Welcome page
Tools box

 

Attention : identified bug on indenting SQLRPGLE which sql field name in mixed case. They are lowered.

Versionning :

last version : The SaveFiles

  PDM option : IN =   INDENT LIBRARY(&L) FILE(&F) MEMBER(&N) TYPE(&S) ERASE5(*NO) CASECONV(*CAMELCASE *DEFN *CAMELCASE) COLORCOM('1') CLEAR5(*NO)
Cet outil permet de numéroter les boucles RPG. Un de plus. Celui-ci a une fantaisie supplémentaire : il indente les boucles en code Free-RPG de 3 caractères, ce qui en améliore fortement la lisibilité : voir le code du programme

Liste des fonctions sur le code Free-RPG :

  • Indente chaque boucle de 3 caractères (constante IndentSize)
  • change la couleur des commentaires
  • ne change rien aux lignes contenant une quote
  • indente les lignes RPG splittées
  • compresse les espaces en trop
  • distingue les procédures (boucles de niveau 00)
  • distingue les sous-programmes (boucles de niveau 1)
  • garanti que le code reste entre les colonnes 8 et 80
  • garanti que code + commentaire reste entre les colonnes 8 et 100
Option "no sql indent"
Pour empecher INDENTLE de toucher du code SQL,  ajouter le commentaire "no sql indent" sur la ligne exec sql : exemple :
exec sql // no sql indent
This tool permits to number the RPG loops. One more. This one has a supplementary fantasy: it indents the loops in Free-RPG code of 3 characters, what improves the readability strongly. Look at  the code of the program

List of the functions on the Free-RPG code: 

  • Indente each loop of 3 characters (IndentSize constant) 
  • change the color of the comments 
  • don't change anything to the lines containing a quote 
  • indent the splitted RPG lines
  • remove the doubled spaces
  • distinguish the procedures (level 00 loop) 
  • distinguish the subroutines (level 01 loop) 
  • guaranteed that the code stay between the columns 8 and 80 
  • guaranteed that code + comment stay between the columns 8 and 100
Option "no sql indent"
To stop INDENTLE from touching the SQL code, add the comment" no sql indent " on the exec sql line: example: 
exec sql / / no sql indent

/* -
Having RPG Free progs correctly indented -
-
purpose: -
-
when writing rpg free programm, you can indent your code to -
obtain code very easy to read. This utility improve a common -
tool to add indentation of the free code, even mixed with C -
cards (i.e., it works also with SQLRPGLE) -
-
rules : -
-
* column 1 to 3 is reserved for "if" numbering quite like rpg compiler in listing : -
set at 1 -
'B' for begin of loop (if, do, select, ...) -
'X' for invert loop (else, when, ...) -
'E' for end of loop -
set at 2-3 the loop deepness -
* in fix format, -
- take care of table load at compil time (** at 1-2) -
- set x'22' (=white) at 5 if 7=* -
* in free format -
- start code at 7 -
- add 3 spaces for each level of deepness -
-
PDM option : (STRPDM then 3 then F16) -
IN CALL PGM(INDENTC) PARM(&F &L &N &T) -
-
-
*/