Default valued procedure / function parameters lazarus / 61-Beginners ---------------------------------------------------------------------- OldProNew · 2021-07-31 20:53 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 htt ps://forum.lazarus.freepascal.org/Smileys/ExcellentSmileys1/cool.gif const 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; ---------------------------------------------------------------------- FTurtle · 2021-07-31 22:16 Quote from: jamie on August 01, 2021, 12:11:15 amLooks like the compiler wants only compile time constants. Compiler wants real constant. Typed constant in Pascal is initialized variable. Solution: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i const kMAX = Integer(12345) ; ---------------------------------------------------------------------- OldProNew · 2021-07-31 23:20 FTurtle...              Thank you.