Enhancement for the Sort editor expert

 Delphi, GExperts  Comments Off on Enhancement for the Sort editor expert
Apr 232016
 

One of the editor experts in GExperts that come in handy once in a while is the Sort Expert. All it does is take the selected lines and sort them alphabetically.

Now, it can sort ascending, as before, descending (not sure when you might want to do that, but since I was at it, why not implement it?) and it can reverse the current line order. The latter is useful, if you want to undo changes in reverse order.

In addition, a new option allows to sort procedures / functions by name, ignoring the procedure / function prefix of the line, so

function c: integer;
procedure b;
function a: integer;

can be sorted like this:

function a: integer;
procedure b;
function c: integer;

rather than this:

function a: integer;
function c: integer;
procedure b;

Sort-Selected-Lines-Expert

 Posted by on 2016-04-23 at 19:31

FixInsight vs. GExperts

 Delphi, GExperts  Comments Off on FixInsight vs. GExperts
Apr 232016
 

Roman Yankovsky has been so kind to donate a FixInsight license to my open source projects, in particular to GExperts.

And since he just blogged about running FixInsight against the latest FMX I did the same with GExperts.

The result is not too bad actually. All included there are 235 warnings, optimization and convention messages. Most messages are about

  • Fields, that are not prefixed with F
  • Local Variables that hide class fields/methods/properties
  • const missing for unmodified string parameters
  • empty then blocks and empty procedures
  • for variables that are not used in the loop (all of them legit)

There are some warnings about variables assigned twice successively, but these are actually assignments to properties with side effects (e.g. TTimer.Enable being set to false and then to true to restart it).

The overall code quality of GExperts is very good compared to other source code I have seen.

I’ll go through all those messages and clean them up if possible.

 Posted by on 2016-04-23 at 15:51