SRL Archive - Suggestions

Quick/Block Commenting


anonymity

2011-11-15 17:34:08

- Select an area (or ctrl+a), press some key command (ex: ctrl+k) and the text would be commented appropriately.

There are two examples of this that I am thinking of.
Ignoring Quotation Marks, "//" and "{}"

EX 1 : Clicking on the following line of text, "x :=(x-1);"
function Herp(derp: integer): integer;
var
x: integer;
begin
x := 0;

while (x < derp) do
begin
x := (x+2);
x := (x-1);
x := (x+3);
x := (x-2);
end;

result := x;
end;

- and after Quick/Block Commenting (button or key-command):

function Herp(derp: integer): integer;
var
x: integer;
begin
x := 0;

while (x < derp) do
begin
x := (x+2);
//x := (x-1);
x := (x+3);
x := (x-2);
end;

result := x;
end;


EX 1b : Selecting the following lines of text:
"
x :=(x-1);
x :=(x+3);
x :=(x-2);
"

function Herp(derp: integer): integer;
var
x: integer;
begin
x := 0;

while (x < derp) do
begin
x := (x+2);
x := (x-1);
x := (x+3);
x := (x-2);
end;

result := x;
end;

- and after Quick/Block Commenting(button or key-command):

function Herp(derp: integer): integer;
var
x: integer;
begin
x := 0;

while (x < derp) do
begin
x := (x+2);
//x := (x-1);
//x := (x+3);
//x := (x-2);
end;

result := x;
end;


EX 2 : Selecting the following bit of text, "< derp"
function Herp(derp: integer): integer;
var
x: integer;
begin
x := 0;

while (x < derp) do
begin
x := (x+1);
end;

result := x;
end;

- and after Quick/Block Commenting (button or key-command):
- note the difference here, where you can keep the inline comment and continue with the line of code

function Herp(derp: integer): integer;
var
x: integer;
begin
x := 0;

while (x {< derp}) do
begin
x := (x+1);
end;

result := x;
end;

Ideally, the commenting would be able to go both ways.
- if the line(s) are not commented, then comment them.
- if the line(s) are commented, then un-comment them.

Sir R. M8gic1an

2011-11-15 19:01:12

Sounds like a cool feature to me :)

-RM

bbri06

2011-11-15 19:10:48

That sounds like a wonderful feature.