Difference between revisions of "Turn warnings and hints on or off"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "There are several ways to control the behavior of warnings in both the Lazarus IDE and in the source code itself. Some warnings and hints are not very useful in a particular c...")
 
Line 15: Line 15:
 
=== Lazarus options ===
 
=== Lazarus options ===
 
== Global option ==
 
== Global option ==
Go to the Project Options->Compiler Options->Messages and uncheck 'Hint:Paramater "$1" not used'.
+
Go to the Project Options->Compiler Options->Messages and uncheck 'Hint:Paramater "$1" not used'.<br>
This will turn of this particular hint for your whole project.
+
This will turn of this particular hint for your whole project.<br>
If you would like to turn off this hint for all your projects, you can check the left bottom checkbox 'Set compiler options as default'[[File:lazarusglobal.png]]
+
If you would like to turn off this hint for all your projects, you can check the left bottom checkbox 'Set compiler options as default'.<br>
 +
 
 +
 
 +
[[File:lazarusglobal.png]]

Revision as of 10:34, 14 May 2017

There are several ways to control the behavior of warnings in both the Lazarus IDE and in the source code itself. Some warnings and hints are not very useful in a particular case so you want to hide them from view. On the other hand, if you would hide warnings or hints globally, you may want to turn a particular warning or hint explicitly on for a particular piece of your code.

procedure TForm.Button1Click(sender:Tobject);
begin
  // DoSomethingThat does not use sender
  Form1.Button1.Caption := 'Test';  
end;

This will generate a hint that parameter sender is not used. Doh. I can see that!. Problem is that this hint turns up all over the place and I know what it means. How do I get rid if it?

Lazarus options

Global option

Go to the Project Options->Compiler Options->Messages and uncheck 'Hint:Paramater "$1" not used'.
This will turn of this particular hint for your whole project.
If you would like to turn off this hint for all your projects, you can check the left bottom checkbox 'Set compiler options as default'.


lazarusglobal.png