For strings, that is only true when LONGSTRINGS ON is in effect and the parameter is not a shortstring.
That statement is 100% correct.
The reason I rejected it (or better stated, wanted to clarify it)
strings and dynamic arrays already contain an implicit ref.
There is NO implicit reference if a function parameter is a shortsting, either because of LONGSTRINGS OFF or explicitly specifying the type as shortstring and, neither const nor constref is specified, it will NOT be passed by reference, IOW, there is
no implicit refAnd after I made it clear that it was wrong, you agreed with @marcov.
What I posted was not wrong at all. It was and, still is correct. The code I posted along with the disassembly proves it. There is no implicit ref, the parameter will be copied, i.e, passed by value.
That said, you posted an example were you used "const" which for strings happens to be the same as "constref". What you showed in the example/code you presented is correct BUT your example EXPLICITLY, by the use of "const," is indicating that the parameter is passed by reference. It is NOT implicit as Marco stated.
No. The reason you are getting that is because you specified "const" in the parameter, which for strings happens to be the same as specifying constref,
Good answer
Things got mixed up and I am in part responsible. Marco, in his post, also referred to "const" which has the effect of passing the string by reference (as you showed) so I have to agree with that part.
The part, which is the initial point I made, is that there is
no implicit ref when passing strings when LONGSTRINGS is OFF or when passing a shortstring.
Hopefully, this is straight now. There is
no implicit ref when passing strings to a function either when LONGSTRINGS is OFF or the parameter is a shortstring.
ETA:Note that the refness of const depends on type and ABI.
That's part of the problem too. The Programmer's reference guide warns about "const" not meaning "pass by reference" (as it is in Delphi) but, it doesn't say anything about when it implies "pass by reference" and when it doesn't. Basically, if you want to know, look at the assembly code and figure it out yourself.