Doing a a simple demo. Can anyone think of any other places an attribute can go?

Doing a a simple demo.  Can anyone think of any other places an attribute can go?

  [Sample]
  TAttributesEverywhere = class
  private
    [Sample] FSomeProperty: Extended;
    procedure SetSomeProperty(const Value: Extended);
  public
    [Sample]
    procedure DoThis([Sample]aParameter: string);
    [Sample]
    function DoThat([Sample]aParameter: TObject): integer;
    [Sample]
    property SomeProperty: Extended read FSomeProperty write SetSomeProperty;
  end;

Comments

  1. I should add "that isn't already being demonstrated."

    ReplyDelete
  2. Graeme Geldenhuys The what? There's documentation?? ;)

    ReplyDelete
  3. Well, you can have multiple attributes at each location, Nick Hodges.

    ReplyDelete
  4. Maybe add the attribute also in a derived class.

    ReplyDelete
  5. +1 for check the Delphi Documentation

    ReplyDelete
  6. Look at this SO question, "Which language elements can be annotated using attributes language feature of Delphi?" :
    http://stackoverflow.com/q/6119986/576719

    ReplyDelete
  7. Awesome -- that SO answer is exactly what I was looking for.

    ReplyDelete

Post a Comment