Do you know how to quickly perform the following tasks using Embarcadero Delphi (or add ins) ? :

Do you know how to quickly perform the following tasks using Embarcadero Delphi (or add ins) ? :

o   Fastest way to create a procedure in interface and implementation ? for someone coming from other language, the "double declaration" principe of delphi is painful .... Is there a fast way to create both interface and implementation declarations ?

o   Auto-fill property created in model view (or another quick way to generate properties) ? : by default , empty setters and getters procedures are performed , which is source of potential errors ; implementing   FMyVar := val; and  Result := FMyVar; doesn't sound so complex

o   Easy way to manage interface inheritance ? In VS you can easily create all procedures when you inherit from an interface. And when you modify an interface,  creating procedures in an inherited class is done in one click .

Ty for your feedback

Comments

  1. use modelmaker.....it's very powerfull..........

    ReplyDelete
  2. 1) You can write the method in the class declaration and use code completion (Ctrl+Shift+C).
    2) It doesn't sound more complex than an empty getter/setter but if it's not what you wanted it's just as wrong (or more). Here my answer is no, I don't know how to do this but I could probably write such a tool if I needed it and couldn't find an existing one already.
    3) In your class declaration, use Code Insight (Ctrl+Space), you'll get a popup with a list of inheritable methods from ancestor classes and relevant interface methods which you can (re-)implement, too. (The list is multi-selectable and pressing Enter generates the selected methods.)

    ReplyDelete
  3. In addition to Ondrej Kelle 's excellent comment, when you declare a class that inherits an interface, you can do the following:
    ISomething = interface
      procedure P1;
      procedure P2;
      procedure P_N;
    end;

    TSomething = class(TInterfacedObject, ISomething)
      [CTRL+SPACE] here and do SHIFT+ARROW DOWN to select multiple methods from ISomething and press ENTER, then CTRL+C to complete class declaration(i.e. create all procedure TSomething.P...; in the implementation section)
    end;

    ReplyDelete
  4. Thank you very much for your feedback ! I did not noticed the ctrl+space trick, this is great !

    ReplyDelete
  5. Olivier SCHWAB forgot to mention in my comment, when you do CTRL+SPACE inside a class that inherits methods form an interface, they appear in red, well, they did anyways, not sure if it still applies to XE3

    ReplyDelete
  6. That reminds me of my favorite shortcut inside the parameter list of a method call: Ctrl-Shift-Space.

    ReplyDelete

Post a Comment