Why do neither of the following functions - with a default valued parameter - compile?
The compiler says "illegal expression" after the symbol "kMAX".
Probably something very trivial... but what?
(No, don't tell me the functions are silly. I know that!
Just simple examples of the problem I'm having with default valued parameters using named, typed constants as the default value. Replacing "kMAX" with "12345" makes the compiler happy, but not me
https://forum.lazarus.freepascal.org/Smileys/ExcellentSmileys1/cool.gifconst kMAX: integer = 12345 ;
function TEST1(A: integer; const B: integer = kMAX): boolean ;
begin
TEST1 := (A <= B)
end;
function TEST2(A: integer; B: integer = kMAX): boolean ;
begin
TEST2 := (A <= B)
end;