But your problem still my first answer, using the "magic word" constref or not, doesn't change nothing to your problem.
The use of constref has nothing to do with the question I asked. In addition to that, the statement about constref from one of your previous posts:
About contref, from lazarus doc: The contref notes for version 2.6 suggest that this can be used for interfacing with external routines in other languages, where this type of parameter passing is required. Other uses of constref may hinder the compiler from optimizing code.
In other words: If you do not need to interface with "external lib or program" where this parameter is mandatory, do not use it.
is incorrect no matter where you got it from. Write some sample programs using constref and look at the code that is generated with and without it. That way, you'll know what it does.
Here is an excerpt from the Free Pascal Reference Guide (page 192)
Specifying a parameter as Constant is giving the compiler a hint that the contents of the parameter will not be changed by the called routine. This allows the compiler to perform optimizations which it could not do otherwise, and also to perform certain checks on the code inside the routine: namely, it can forbid assignments to the parameter. Furthermore a const parameter cannot be passed on to another function that requires a variable parameter: the compiler can check this as well. The main use for this is reducing the stack size, hence improving performance, and still retaining the semantics of passing by value...
Remark: Contrary to Delphi, no assumptions should be made about how const parameters are passed to the underlying routine. In particular, the assumption that parameters with large size are passed by reference is not correct. For this the constref parameter type should be used, which is available as of version 2.5.1 of the compiler.
An exception is the stdcall calling convention: for compatibility with COM standards, large const parameters are passed by reference.
IOW, it's darn close to the opposite of what you stated. Not only you don't answer the question that has been asked but, in addition to that, you give incorrect information. That is not the definition of being helpful. If you want to be helpful, make sure what you suggest is correct and works by
testing it before you post it.
BTW, what the Free Pascal Reference Guide states is correct, I tested it.