Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-02

How about Ctrl+Shift+Alt+Space completes code with empty values.

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Everton Vieira

How about Ctrl+Shift+Alt+Space completes the code with empty values.

Like this:

Trim();

After Ctrl+Shift+Alt+Space inside that parentheses makes this:

Trim('');

Just, another idea. :)

Reply by email

ik
to Everton Vieira
Everton Vieira wrote 12 lines
How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim(); After Ctrl+Shift+Alt+Space inside that parentheses makes this: Trim(''); Just, another idea. :)

Or the CTRL+SHIFT+C continue to complete code, on this cases as well :)

Show quoted text 7 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120214/6c5c9bda/attachment.html>

Reply by email

Everton Vieira
to ik
ik wrote 14 lines
On Tue, Feb 14, 2012 at 19:43, Everton Vieira wrote: How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim(); After Ctrl+Shift+Alt+Space inside that parentheses makes this: Trim(''); Just, another idea. :) Or the CTRL+SHIFT+C continue to complete code, on this cases as well :)

Sure will be better than memorize another shortcut is to specialize one thats already exists.

Show quoted text 13 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120214/576a413a/attachment.html>

Reply by email

Graeme Geldenhuys
to Everton Vieira: How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim();…
Everton Vieira wrote 9 lines
How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim(); After Ctrl+Shift+Alt+Space inside that parentheses makes this: Trim('');

Why not simply type the single quote key twice, instead of a complex four-key combination. Thus, resulting in less keys to type. I can suggest a good typing tutor program too, if you have problems typing. ;-)

Just another idea. :)

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Martin
to Everton Vieira: How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim();…
Everton Vieira wrote 12 lines
How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim(); After Ctrl+Shift+Alt+Space inside that parentheses makes this: Trim(''); Just, another idea. :)

You do know shift-ctrl-space ?
Which opens a hint showing the possible parameter list(s). That also has the advantage to work if there are overloaded versions.

In 0.9.31 you can then insert the one you need, with the mouse (sorry no keyboard)

Reply by email

Lukasz Sokol
to Everton Vieira: How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim();…
Everton Vieira wrote 12 lines
How about Ctrl+Shift+Alt+Space completes the code with empty values. Like this: Trim(); After Ctrl+Shift+Alt+Space inside that parentheses makes this: Trim(''); Just, another idea. :)

Trim is bad example :) but if you wanted Ctrl+Shift+Alt+Space to expand, e.g.

AnsiReplaceString()
into
AnsiReplaceString('','','')

What would you put as 'empty' parameter for functions that have numeric meaning, and don't really tolerate 0 as input
(hypothetical: function Divide(A: integer; B: integer):Real; if you expand Divide() to Divide(0,0) and forget to put some meaningful constant into B (or variable) you'll end up with executing div/0 and as such, an error)

As such such expansion IMO is futile.

L.

Reply by email

Everton Vieira
to Martin: You do know shift-ctrl-space ? Which opens a hint showing the possible parameter list(s).…
Martin wrote 16 lines
On 14/02/2012 17:43, Everton Vieira wrote: > How about Ctrl+Shift+Alt+Space completes the code with empty values. > > Like this: > > Trim(); > > After Ctrl+Shift+Alt+Space inside that parentheses makes this: > > Trim(''); > > Just, another idea. :) > You do know shift-ctrl-space ? Which opens a hint showing the possible parameter list(s). That also has the advantage to work if there are overloaded versions.

I know. Thanks.

Show quoted text 14 lines
In 0.9.31 you can then insert the one you need, with the mouse (sorry no keyboard) -- a good overview http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools http://wiki.lazarus.freepascal.org/New_IDE_features_since -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Everton Vieira
to Lukasz Sokol: Trim is bad example :) but if you wanted Ctrl+Shift+Alt+Space to expand, e.g.…
Lukasz Sokol wrote 22 lines
On 14/02/2012 17:43, Everton Vieira wrote: > How about Ctrl+Shift+Alt+Space completes the code with empty values. > > Like this: > > Trim(); > > After Ctrl+Shift+Alt+Space inside that parentheses makes this: > > Trim(''); > > Just, another idea. :) > Trim is bad example :) but if you wanted Ctrl+Shift+Alt+Space to expand, e.g. AnsiReplaceString() into AnsiReplaceString('','','') What would you put as 'empty' parameter for functions that have numeric meaning, and don't really tolerate 0 as input

As a code complementation suggestion theres no need to put 0 instead is better only put the comma when the parameter is required.

Show quoted text 5 lines
(hypothetical: function Divide(A: integer; B: integer):Real; if you expand Divide() to Divide(0,0) and forget to put some meaningful constant into B (or variable) you'll end up with executing div/0 and as such, an error) As such such expansion IMO is futile.

This idea came when i had to type about ten times a function like this func('', '', [], '', [] , []); wich time the parameters changed, of course i did ctrl+c ctrl+v. This would be only a very subtle behavior. Like every one knows, details are in the art of the elegancy.

Show quoted text 9 lines
L. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Lukasz Sokol
to Everton Vieira
Everton Vieira wrote 5 lines
As a code complementation suggestion theres no need to put 0 instead is better only put the comma when the parameter is required.

[...]

Show quoted text 6 lines
This idea came when i had to type about ten times a function like this func('', '', [], '', [] , []); wich time the parameters changed, of course i did ctrl+c ctrl+v. This would be only a very subtle behavior. Like every one knows, details are in the art of the elegancy.

Well as such, it /may/ be viable and useful (put just commas _between_ parameters) but '' and [] is making an exception to the rule so I'd rather func(,,,,,) or func( , , , , , ) than what you suggest; This however requires that you can only add parameters to the last place of definition, and never-ever reorder them, having the editor track that you've added a parameter in the middle of the definition and change invocation accordingly is probably not going to be well-accepted maintenance-wise...

What for the functions that have parameters with default values, that are only used in exceptional cases ? Do you want to show the non-default param placeholders only?

L.

Reply by email

Everton Vieira
to Lukasz Sokol
Lukasz Sokol wrote 18 lines
On 15/02/2012 10:27, Everton Vieira wrote: > > > As a code complementation suggestion theres no need to put 0 instead > is better only put the comma when the parameter is required. > [...] > This idea came when i had to type about ten times a function like > this func('', '', [], '', [] , []); wich time the parameters changed, > of course i did ctrl+c ctrl+v. This would be only a very subtle > behavior. Like every one knows, details are in the art of the > elegancy. > Well as such, it /may/ be viable and useful (put just commas _between_ parameters) but '' and [] is making an exception to the rule so I'd rather

The exceptions are the ones that makes shine.

func(,,,,,) or func( , , , , , ) than what you suggest; This however requires that you can only add parameters to the last place of definition,

Why is that so? Is only a code complementation.

and never-ever reorder them, having the editor track that you've added a parameter

Same here.

Show quoted text 5 lines
in the middle of the definition and change invocation accordingly is probably not going to be well-accepted maintenance-wise... What for the functions that have parameters with default values, that are only used in exceptional cases ? Do you want to show the non-default param placeholders only?

The default lets not complete, after all, they have default values just because isn`t need in a considered number of cases.

Ctrl+Shift+C specialized is the better option for, i guess.

Show quoted text 9 lines
L. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Everton Vieira
to Everton Vieira

And of course there`s the overload statements, that can receive an special/exceptional treatment as well.

Everton Vieira wrote 53 lines
Em 15/02/2012, ?s 10:35, Lukasz Sokol escreveu: > On 15/02/2012 10:27, Everton Vieira wrote: >> >> >> As a code complementation suggestion theres no need to put 0 instead >> is better only put the comma when the parameter is required. >> > [...] > > >> This idea came when i had to type about ten times a function like >> this func('', '', [], '', [] , []); wich time the parameters changed, >> of course i did ctrl+c ctrl+v. This would be only a very subtle >> behavior. Like every one knows, details are in the art of the >> elegancy. >> > > Well as such, it /may/ be viable and useful (put just commas _between_ parameters) > but '' and [] is making an exception to the rule so I'd rather The exceptions are the ones that makes shine. > func(,,,,,) or func( , , , , , ) than what you suggest; > This however requires that you can only add parameters to the last place of definition, Why is that so? Is only a code complementation. > and never-ever reorder them, having the editor track that you've added a parameter Same here. > in the middle of the definition and change invocation accordingly is probably not going > to be well-accepted maintenance-wise... > > What for the functions that have parameters with default values, that are only used > in exceptional cases ? Do you want to show the non-default param placeholders only? The default lets not complete, after all, they have default values just because isn`t need in a considered number of cases. Ctrl+Shift+C specialized is the better option for, i guess. > > L. > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email