(* This is trivial code to demonstrate a problem I've run into. When I try to compile this code, I get a warning
Hint: Variable 'c' does not seem to be initialised.
Which is untrue, it is initialised in the procedure Ask.
My question is how do I turn off hints and warnings for that sort of thing. Lazarus gives me several options to deal with this ...
Hide message by inserting IDE directive {%H-}
Hide message by inserting {$warn 5058 off} to unit "project1.lpr"
Hide with project option {-vm5058}
I guess I can use the first option but really don't want a whole heap of {%H-} directives spread through my code. And I think to use it effectively, I'd have to rewrite
ask(c);
... as ...
{%H-} ask(c); {%H+}
I searched all the pdf files that came with the program and I cannot find any reference to 5058 though I can guess what it means. Is there a better way to acknowledge the hint, then turn the hint off. Also searching all the pdf files, I can't find any reference to %H and it's only through experimentation that I've been able to come to the above semi-solution.
*)
program Project1;
Uses
Crt;
var
c: char;.
{----------------------------------------------------------------------}
procedure Ask(var ch:char);
begin
ch:=readkey;
end;
{----------------------------------------------------------------------}
begin
ask(c);
writeln(c);
readkey;.
end { Program Project1 } .