dummzeuch 1505 Posted March 2, 2022 (edited) I remember that for one particular Delphi version there was a hidden Code Insight option to automatically fill in the parameters for a function call. What I mean by that is, given a function declared as function bla(FirstParam, SecondParam: integer; out ThirdParam: string): byte; when you enter a call to it in the editor MyVar := bla( and press some hotkey, the function call would be automatically completed as MyVar := bla(FirstParam, SecondParam, ThirdParam); I don't mean the hint on parameters that is still available, but actually adding this text into the editor. To enable this, you needed to set a particular registry key. This was only possible in one particular Delphi version (2006?) and was removed in the next version. If I remember correctly some Borland (Inprise / Codegear ?) employee blogged about it. Does anybody remember the specifics? Edited March 2, 2022 by dummzeuch Share this post Link to post
PeterBelow 238 Posted March 2, 2022 7 hours ago, dummzeuch said: I remember that for one particular Delphi version there was a hidden Code Insight option to automatically fill in the parameters for a function call. What I mean by that is, given a function declared as function bla(FirstParam, SecondParam: integer; out ThirdParam: string): byte; when you enter a call to it in the editor MyVar := bla( and press some hotkey, the function call would be automatically completed as MyVar := bla(FirstParam, SecondParam, ThirdParam); I don't mean the hint on parameters that is still available, but actually adding this text into the editor. To enable this, you needed to set a particular registry key. This was only possible in one particular Delphi version (2006?) and was removed in the next version. If I remember correctly some Borland (Inprise / Codegear ?) employee blogged about it. Does anybody remember the specifics? I don't think that ever existed. If it did it would be completely useless since the actual variables you pass to a function call are rarely (in my case never ) named the same as the parameters in the function declaration. Share this post Link to post
dummzeuch 1505 Posted March 3, 2022 (edited) 8 hours ago, PeterBelow said: I don't think that ever existed. If it did it would be completely useless since the actual variables you pass to a function call are rarely (in my case never ) named the same as the parameters in the function declaration. I'm 100% sure that it existed and that I used it at some time. I also remember being disappointed when it didn't turn up as a regular feature in the next Delphi version and couldn't be activated any more. As for it being useless, I disagree. It's useful if your calling code is just a small function and you don't have to think about naming those variables and typing them. Thus it promotes better variable names. It also prevents typing mistakes. Edited March 3, 2022 by dummzeuch Share this post Link to post
Pat Foley 51 Posted March 4, 2022 Wouldn't a custom template do? Hitting CreateC shown with Control-J yields constructor Create(AOwner: TComponent); override; Share this post Link to post
dummzeuch 1505 Posted March 4, 2022 10 hours ago, Pat Foley said: Wouldn't a custom template do? Hitting CreateC shown with Control-J yields No, because that would only create the code for one particular function call. What I'm after is generating the code for any function that's available through Ctrl+Space. Share this post Link to post
Pat Foley 51 Posted March 4, 2022 You are saying local variable names are prefixed with 'a' when your function is used? That lets the person reading the code know what variables are to be touched outside the procedure. That's better than marking the variables that are not touched outside a procedure with an L. I think the Help insight control J s for summary is good. It has better latency than the Control Space business. Share this post Link to post
dummzeuch 1505 Posted March 4, 2022 1 hour ago, Pat Foley said: You are saying local variable names are prefixed with 'a' when your function is used? No, I'm not saying that. Share this post Link to post