Hide the routine from Delphi auto-complete

There is a little trick for hiding the routine from the Delphi autocomplete:

type
  TTest = class
  public
    procedure &&DoThat;
  end;

procedure TTest.&&DoThat;
begin
end;

var
  X: TTest;
begin
  x.&&DoThat;
end.

If you put two ampersands in front of identifier you will never get it in Delphi auto-complete window. Delphi class completion even fails to correctly generate the declaration after Ctrl+Shift+C 🙂 – it generates the implementation with only one ampersand (so you need to add another one).

You will need to find the real life use of this by yourself 😉

Enjoy.

One comment

  1. Great tip. Or if you have class with member method with same name as reserved keyword. You just add one ampersand before and it’s working. For instance class where you would like to have function with name Type… so if you define function &Type: TSomeType; you can have such function name.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s