
+5
Planned
Warn about unused local constants
If you have a method which declares some constants, and those constants are not used, no warning is generated by Delphi. IMO there should be a warning, just like for variables that are not used.
Eg,
procedure TForm1.Foo;
const
A = 1;
B = 2;
var
C,
D : Integer;
begin
C := B;
Caption := IntToStr(C);
end;
Delphi warns about unused variable D, but not unused constant A.
Eg,
procedure TForm1.Foo;
const
A = 1;
B = 2;
var
C,
D : Integer;
begin
C := B;
Caption := IntToStr(C);
end;
Delphi warns about unused variable D, but not unused constant A.

+1
David Millington 10 years ago
Posted by 'Anonymous', but it was me.

0
Planned
Roman 10 years ago
Customer support service by UserEcho