BCS Tidy Class Sort

The BCS Tidy Application has a utility to sort the Delphi class.

cla01

The unsorted class is represented below.

/// Main Class
  Tfrm017 = class(TCustomForm)
 
  private
    procedure estMainMenu;
    procedure estStatus(pan1, pan2, int: Integer);
    procedure estWindow(top, width, height: Integer; Caption: string);
    procedure OnMenuClick(Sender: TObject);
    procedure OnTimer(Sender: TObject);
    procedure XQT(cmd, parm, defPath: string);
    procedure btnSaveClick(Sender: TObject);
    procedure btnClick(Sender: TObject);
    procedure WebBrowser1DocumentComplete(ASender: TObject;
      const pDisp: IDispatch; const rURL: OleVariant);
    procedure URLClick(Sender: TObject);
    procedure URLKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure broNavigateComplete2(ASender: TObject; const pDisp: IDispatch;
      const URL: OleVariant);
 
  public
    procedure WebBrowser1DocumentComplete(ASender: TObject;
      const pDisp: IDispatch; const rURL: OleVariant);
    procedure frmShowModal();
    procedure broNavigateComplete2(ASender: TObject; const pDisp: IDispatch;
      const URL: OleVariant);
 
  end;

The re-ordered class statement appears below.

/// Main Class
  Tfrm017 = class(TCustomForm)
 
  private
    procedure broNavigateComplete2(ASender: TObject; const pDisp: IDispatch;
      const URL: OleVariant);
    procedure btnClick(Sender: TObject);
    procedure btnSaveClick(Sender: TObject);
    procedure estMainMenu;
    procedure estStatus(pan1, pan2, int: Integer);
    procedure estWindow(top, width, height: Integer; Caption: string);
    procedure OnMenuClick(Sender: TObject);
    procedure OnTimer(Sender: TObject);
    procedure URLClick(Sender: TObject);
    procedure URLKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure WebBrowser1DocumentComplete(ASender: TObject;
      const pDisp: IDispatch; const rURL: OleVariant);
      const URL: OleVariant);
 
  public
    procedure broNavigateComplete2(ASender: TObject; const pDisp: IDispatch;
      const URL: OleVariant);
    procedure frmShowModal();
    procedure WebBrowser1DocumentComplete(ASender: TObject;
      const URL: OleVariant);
 
  end;

The ordering of the class is accomplished by collecting the associated blocks of code and providing a mechanism to sort procedure name in an ascending alphabetical sequence and merge the results (in place) to the Delphi source code.  This is accomplished by using sorted string lists.

A 32-bit executable program may be downloaded by clicking here.
A 64-bit executable program may be downloaded by clicking here.
The component documentation can be found by clicking here.
The source code may be found by clicking here.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply