Re: Little interesting idea to quickly add local variable, maybe even fields.



Skybuck Flying wrote:
Suppose you programming some routine like so:

procedure SomeRoutine;
begin

... blablabla...


// Now you want to add an index variable called: vIndex of type integer.
// The idea is to type the following:
var vIndex : integer;

// then when pressing shift-enter... delphi simply adds this line of text to some routine like so:

end;

procedure SomeRoutine;
var
vIndex : integer;
begin

... blablabla ...

end;

Borland added that feature in Delphi 2006. It's one of several Live Templates. Press Tab after you type "var" and there you go.

--
Rob
.



Relevant Pages

  • Re: GetComputerName
    ... > - Delphi allows us to send it to APIs as a PChar ... > Some APIs perform differently between versions of Windows ... > Reporting the result of GetLastError is a pretty generic task ...
    (alt.comp.lang.borland-delphi)
  • Re: Question: how to read any one character from keyboard
    ... Doesn't anyone use Delphi anymore? ... the user at one point to "press any key" (it's a console app and this ... The help says that if you use Read with a Char var, ...
    (alt.comp.lang.borland-delphi)
  • Re: Generics for Delphi
    ... fVaribale: Array of Integer; ... Unfortunately, I can see the similarity, but that doesn't mean I have to like it :-) This is the point I am trying to make about matching generic delegate types to handlers; I can see unwanted complexity about to rear its ugly head :-( I must admit that things like this have always put me off Pascal from before I ever saw Delphi; it was only the superb Delphi IDE that "encouraged" me to use Pascal in the first place. ... public class MyClass<typeT>: MyClass ...
    (borland.public.delphi.non-technical)
  • Re: C++ to Delphi, HELP !!!
    ... I think this is a Delphi implementation of the BluffTitler C++ ... PtrData: PCopyDataStruct; ...
    (alt.comp.lang.borland-delphi)
  • Re: C++ to Delphi, HELP !!!
    ... I think this is a Delphi implementation of the BluffTitler C++ ... PtrData: PCopyDataStruct; ...
    (alt.comp.lang.borland-delphi)