comment réindenter le code source ?

Il est très difficile de s’y retrouver dans le code lorsqu’on passe après plusieurs développeurs avec des styles très différents !

  • Pour les versions anciennes de Progress : sans OpenEdge , utiliser jolicode.p ou beauty.p
  • Pour les versions récentes : utiliser PDSOE et CTRL-I ou CTRL+MAJ+i
    • Menu : Windows > Preferences > General > Editors > Text Editors
    • Menu : Windows > Preferences > Progress OpenEdge > Editor

PDSOE: How to improve the Indentation (CTRL+I) in Progress Developer Studio?

CTRL+I feature is used to automatically correct the indentation of a source file,
By default this follows tabular indentation meaning if there is a source code like below:

On performing CTRL+SHIFT+I all the variables on top of the file will be aligned in a tabular format, the output will look something like this:
The extra space after AS CLASS is because of tabular format indentation, it tries to indent all keywords and other variables under columns, if you observe you can find CTRL+I has arranged all the statements of variables in 5 columns.

However, the tabular formatting can be turned off by changing a preference.
In Windows>Preferences>Progress Openedge>Editor uncheck the option “Enable tabular formatting”

Now performing CTRL+I on <> will result in output which will look something like this:

The code inside REPEAT block is given one tab space to represent that the code is inside REPEAT block.

However do note that once you perform tabular formatting and then removing the preference option will not change the indentation of the variables.

When tabular formatting is enabled, each keyword will be aligned with a new column. The gaps appeared in the code is due to some extra keywords (like Class) in variables definitions.
The tabs are added before each line and the normal code won’t format as Table. When a statement has multiple keywords then only table formatting applies (like var. definitions, temp-table fields etc…).