I was trying to show some code to another person when I subtly perceived that beside when declared variables are not used there is compiler hint messages, there is no hints or messages when a declared constant is not used. Following code is an example:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils,
Math;
const
intM: Integer = 1000;
var
valorDouble, notusedvar: Double;
begin
try
valorDouble := 0.001;
Writeln('--- Codigo atual --');
Writeln('Double -> ', Trunc(valorDouble * 1000));
Writeln('--- Correcao?? --');
Writeln('Trunc(1.0000001) -> ', Trunc(1.0000001));
Writeln('Trunc(0.001 * 1000.0) -> ', Trunc(0.001 * 1000.0));
Writeln('Trunc(0.0010 * 1000.0) -> ', Trunc(0.0010 * 1000.0));
Writeln('Trunc(0.00100 * 1000.0) -> ', Trunc(0.00100 * 1000.0));
Readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
Why there is no hint about the not used constant? There is any logical explanation about this difference?